UITableViewCell左滑多选项
来源:互联网 发布:京东大数据架构 编辑:程序博客网 时间:2024/06/07 01:54
- (NSArray<UITableViewRowAction *> *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewRowAction *likeAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"喜欢" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) { // 实现相关的逻辑代码 // ... // 在最后希望cell可以自动回到默认状态,所以需要退出编辑模式 tableView.editing = NO; }]; UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"删除" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) { // 首先改变model [self.books removeObjectAtIndex:indexPath.row]; // 接着刷新view [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; // 不需要主动退出编辑模式,上面更新view的操作完成后就会自动退出编辑模式 }]; return @[deleteAction, likeAction];}
0 0
- UITableViewCell左滑多选项
- UITableViewCell侧滑显示多个选项按钮
- UITableViewCell
- UITableViewCell
- UITableViewCell
- UITableViewCell
- UITableViewCell
- UITableViewCell
- UITableViewCell
- uitableviewcell
- UITableviewcell
- UITableViewCell
- UITableViewCell
- UITableViewCell
- UITableViewCell
- UITableViewCell
- UITableViewCell
- UITableViewCell
- Ubuntu下的sublime text 2的安装和破解
- linux进程控制
- 多对多数据库创建方式Django
- 苹果鼠标很慢,mac的终端设置
- Android 6.0 权限申请解析!
- UITableViewCell左滑多选项
- Tomcat配置HTTPS访问,强制HTTPS访问
- Oracle基本操作
- 403_DeviceMonitor使用
- HDU-1058-Humble Numbers【思维】
- PMP笔记:项目管理任务
- mysql学习总结
- (十一)jmeter-集合点---学习笔记
- redis liunx下安装