首页 > 移动平台 > 详细

iOS开发小技巧--cell往左拖拽出现很多按钮的实现,仅仅适用于iOS8以后

时间:2016-03-29 00:50:07      阅读:281      评论:0      收藏:0      [点我收藏+]

技术分享

 1 // 往左拖拽cell出现多个按钮的实现,仅仅适用于iOS_8.0以后
 2 - (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
 3 {
 4     UITableViewRowAction *action = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"删除" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
 5         NSLog(@"点击删除的时候调用");
 6     }];
 7     UITableViewRowAction *action2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"编辑" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
 8         NSLog(@"点击编辑的时候调用");
 9     }];
10     action2.backgroundColor = [UIColor grayColor];
11     return @[action,action2];
12 }

 

iOS开发小技巧--cell往左拖拽出现很多按钮的实现,仅仅适用于iOS8以后

原文:http://www.cnblogs.com/gchlcc/p/5331179.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!