/**
* block里面是点击方法 , 这个委托是ios8之后的才有,如果项目只适配ios8以上就可以不用自己写按钮了。返回值是 UITableViewRowAction 的数组
*/
-(NSArray<UITableViewRowAction*>*)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewRowAction *rowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault
title:@"删除"
handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
NSLog(@"删除");
}];
UITableViewRowAction *rowActionSec = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault
title:@"更多"
handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
NSLog(@"更多");
}];
rowActionSec.backgroundColor = [UIColor greenColor];
NSArray *arr = @[rowAction,rowActionSec];
return arr;
}
iOS开发--UITableViewCell侧滑多个按钮(系统仅支持iOS8以上)
最新推荐文章于 2016-12-21 14:04:10 发布
1万+

被折叠的 条评论
为什么被折叠?



