tableView 左滑 修改文字颜色和背景色

2018-06-12  本文已影响0人  William8

啥都不多说了,直接上代码。加上去就可以跑了😆

// 添加按钮
UITableViewRowAction *rowAction1 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"  "handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
    NSLog(@"点击了");

}];
rowAction1.backgroundColor = getColorWithLabelText(@"row1", [UIColor whiteColor], [UIColor lightGrayColor]);

UITableViewRowAction *rowAction2 = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"  "handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
    NSLog(@"点击了");
}];

transferRowAction.backgroundColor = getColorWithLabelText(@"row2", [UIColor blackColor], [UIColor yellowColor]);

return @[rowAction1, rowAction2];

}

上一篇 下一篇

猜你喜欢

热点阅读