iOS开发--UITableViewCell侧滑多个按钮(系统仅支持iOS8以上)
2015-11-23 20:30
603 查看
/** * 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; }
相关文章推荐
- Handler Looper MessageQueue的应用
- UITableviewcell的删除操作
- iOS 中的线程(1)---①performSelectorInBackground②NSThread③NSOperation 和 NSOperationQueue 的组合
- MySQL query / clause execution order
- ueditor过滤
- IOS之UI -- UITableView -- 1 -- 相关初识
- [android] 优化UI卡顿现象
- xmanager - xstart - The X11 forwarding request was rejected
- Kibana User Guide [4.2] » Using Kibana in a Production Environment
- [转]Bluetooth LE Credit-Based Flow Control for L2CAP Connection-Oriented Channels
- easyui 合并
- suibi
- [TwistedFate]UITableView表视图编辑,移动
- codeforces 597C Subsequences
- Github gui使用
- UIAlertView
- UINavigationController总结
- easyUI 验证
- UIViewController的生命周期及iOS程序执行顺序
- CYC-关于UIImagePickerController