How to change UITableViewRowAction title color?

后端 未结 10 867
梦如初夏
梦如初夏 2020-11-30 05:49

Am using UITableViewRowAction in \"editActionsForRowAtIndexPath\" method. I can change the backgroundcolor of UITableViewRowAction, but am not able to change the title color

10条回答
  •  一整个雨季
    2020-11-30 06:36

    -(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"edit" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath)
        {
        // Action something here
    
    }];
    
    editAction.backgroundColor = [UIColor whiteColor];
    [[UIButton appearance] setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    return @[editAction];
    

提交回复
热议问题