写在前面
- 本文使用的IDE为Xcode9.4.1
- 目的是展示在控件TableView加滑动按钮
- 使用的语言为Objective-C
效果如图:
tableViewSlidButton.png
实现方式
只需在iOS OC TableView的使用(1)的.m文件中加入代理方法:
- (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction * Action1 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"按钮1" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
//按钮1激发代码
}];
Action1.backgroundColor = [UIColor redColor];

最低0.47元/天 解锁文章
1408

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



