您的位置:首页 > 产品设计 > UI/UE

自定义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;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: