UITebleViewCell添加侧滑按钮
来源:互联网 发布:mac fliqlo怎么用 编辑:程序博客网 时间:2024/06/06 00:04
-(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;
}
block里面是点击方法 , 这个委托是ios8之后的才有,如果项目只适配ios8以上就可以不用自己写按钮了。返回值是 UITableViewRowAction 的数组
UITableViewRowAction 的大小自动根据文字适配
0 0
- UITebleViewCell添加侧滑按钮
- UITableView侧滑添加多个按钮
- 添加按钮
- FCKeditor添加自定义按钮
- IE工具条添加按钮
- 添加菜单按钮
- fckeditor添加自定义按钮
- TabControl添加关闭按钮
- 按钮控件添加位图
- gridview动态添加按钮
- repeater添加 定制按钮
- JTable单元格添加按钮
- EXTJS 按钮添加右键
- Reapter 添加删除按钮
- win32 application 添加按钮
- 给按钮添加链接
- mfc 按钮添加图片
- office 添加宏按钮
- python之文本爬虫
- 学习windows 应用层 inline hook 原理总结
- 使用Maven新建Java Web项目(八)
- JavaScript_通过onmouseover onmouseout 部分显示与隐藏
- CharacterController.isGrounded总是false
- UITebleViewCell添加侧滑按钮
- svn(版本控制)
- Maven集成Tomcat7开发(九)
- java 使用反射转换对象 Object to Map
- Apache Spark源码走读之4 -- DStream实时流数据处理
- Android 上使用 paho Mqtt 小结
- FMDB的细节
- js+css3制作验证码
- bzoj 1041: [HAOI2008]圆上的整点