自定义UITableViewCell左滑显示编辑按钮
2016-04-27 20:26
821 查看
// 自定义左滑显示编辑按钮
-(NSArray<UITableViewRowAction*>*)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath
*)indexPath
{
UITableViewRowAction*rowAciton=[UITableViewRowAction
rowActionWithStyle:UITableViewRowActionStyleDefault
title:@"删除"
handler:^(UITableViewRowAction *
_Nonnull action, NSIndexPath *
_Nonnull indexPath) {
}];
rowAciton.backgroundColor=[UIColor
blueColor];
UITableViewRowAction*biaojiRowAction=[UITableViewRowAction
rowActionWithStyle:UITableViewRowActionStyleDestructive
title:@"标记未读"
handler:^(UITableViewRowAction *
_Nonnull action, NSIndexPath *
_Nonnull indexPath) {
}];
biaojiRowAction.backgroundColor=[UIColor
redColor];
UITableViewRowAction*zhidingRowAction=[UITableViewRowAction
rowActionWithStyle:UITableViewRowActionStyleNormal
title:@"置顶"
handler:^(UITableViewRowAction *
_Nonnull action, NSIndexPath *
_Nonnull indexPath) {
}];
NSArray*arrAction=@[rowAciton,biaojiRowAction,zhidingRowAction];
return arrAction;
}
-(NSArray<UITableViewRowAction*>*)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath
*)indexPath
{
UITableViewRowAction*rowAciton=[UITableViewRowAction
rowActionWithStyle:UITableViewRowActionStyleDefault
title:@"删除"
handler:^(UITableViewRowAction *
_Nonnull action, NSIndexPath *
_Nonnull indexPath) {
}];
rowAciton.backgroundColor=[UIColor
blueColor];
UITableViewRowAction*biaojiRowAction=[UITableViewRowAction
rowActionWithStyle:UITableViewRowActionStyleDestructive
title:@"标记未读"
handler:^(UITableViewRowAction *
_Nonnull action, NSIndexPath *
_Nonnull indexPath) {
}];
biaojiRowAction.backgroundColor=[UIColor
redColor];
UITableViewRowAction*zhidingRowAction=[UITableViewRowAction
rowActionWithStyle:UITableViewRowActionStyleNormal
title:@"置顶"
handler:^(UITableViewRowAction *
_Nonnull action, NSIndexPath *
_Nonnull indexPath) {
}];
NSArray*arrAction=@[rowAciton,biaojiRowAction,zhidingRowAction];
return arrAction;
}
相关文章推荐
- phalcon builder get raw sql
- iOS UI调试神器,插件injection for Xcode使用方法
- 完美限制UITextField的输入长度
- Codeforces Beta Round #11 A. Increasing Sequence 贪心
- 线程池.(Executors,ThreadPoolExecutor,BlockingQueue,RejectedExecutionHandler).介绍
- android 消息队列 ConcurrentLinkedQueue
- iOS 自定义UIPickerView天数选择器视图 —— HERO博客
- Android bluetooth介绍(四): a2dp connect流程分析
- UICollectionView的基本使用(一)
- Android bluetooth介绍(三): 蓝牙扫描(scan)设备分析
- Android bluetooth介绍(二): android 蓝牙代码架构及其uart 到rfcomm流程
- requestWindowFeature易错处
- Android bluetooth介绍(一):基本概念及硬件接口
- BlueDroid介绍
- UIButton
- MySQL启动参数(五) —— MySQL Query Cache
- UIButton 无法点击的问题
- 改变UITableViewCell删除状态时,改变按钮的背景颜色。
- Easy UI 面板
- easyui_动态添加隐藏toolbar按钮