众所周知,UITableView的左滑删除功能非常的炫酷,有时候左滑需要的功能不止只有删除一个,有时候会有顶置之类的别的功能,这时候就需要我们自己定制左滑
-(NSArray
{
UITableViewRowAction *rowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault
title:@"取消收藏" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
NSLog(@"收藏点击事件");
}];
UITableViewRowAction *rowAction2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault
title:@"顶置" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
NSLog(@"顶置按钮点击事件");
}];
rowAction.backgroundColor =RGB(215, 59, 16);
NSArray *arr = @[rowAction,rowAction2];
return arr;
}
我们可以利用UITableViewRowAction 创建对象,后面的代码块就是点击后执行的方法,创建完的对象加到数组中,这样的话我们就可以随意定制,颜色我们也可以自己选择,非常的方便。
labubu官网购买直达-labubu官网最新价格
漫蛙manwa漫画官方入口-漫蛙漫画app2026免费极速下载
Nano-banana-pro官网直连入口-Nano-Banana-2国内精准直达链接
小鸡漫画官方客户端下载入口在哪安装最新版本-小鸡漫画下载安卓版安装教程免费看
Nano-banana-pro官网直达入口-Nano-banana-pro网页版快捷登录
秘塔网页版官方入口-秘塔官网登录快捷通道