// 自定义左滑显示编辑按钮
-(NSArray<UITableViewRowAction*>*)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewRowAction *rowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault
title:Localized(@"address_delete") handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath)
{
//在这里实现删除操作
}];
rowAction.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"tbadd_bg_sc"]];
NSArray *arr = @[rowAction];
return arr;
}
效果图:

改变UITableViewRowAction背景色以及按钮字体颜色 注意ios13UITableView层级改变了
-(void)tableView:

本文展示了如何在iOS应用中自定义UITableView的左滑编辑按钮样式,特别是针对iOS 13系统进行适配,调整UITableViewRowAction的背景色和按钮字体颜色。
最低0.47元/天 解锁文章
1978





