2013-11-04 77 views
0

这里是增加了一个删除按钮的代码:如何在删除TableViewCell时删除按钮旁边的另一个按钮?

(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath 
{ 

    return YES; 
} 


(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    if (editingStyle == UITableViewCellEditingStyleDelete) { 

     NSLog(@"delete pressed"); 

    } 
    else if (editingStyle == UITableViewCellEditingStyleInsert) { 

    } 
} 
+0

请访问此链接。 http://stackoverflow.com/questions/17254402/swipe-to-delete-and-the-more-button-like-in-mail-app-on-ios-7 –

回答

0

你不能这样做,使用的UITableViewCell,你需要创建自己的自定义UITableViewCells铺陈这些意见自己,当细胞在编辑模式下进入。

+0

你知道任何图书馆,可以帮助我这样做? – user2838188

+0

Apple Docs相当不错https://developer.apple.com/library/ios/documentation/userexperience/conceptual/tableview_iphone/TableViewCells/TableViewCells.html#//apple_ref/doc/uid/TP40007451-CH7-SW1 –