How to control equal width for UITableViewRowAction in iOS8.0? (More, Delete, etc. Actions)

I am using the following code to scroll a UITableViewCell in xcode6 with ios8.0. My code is working fine, but I need to set equal width for UITableViewRowActions (bigger, Delete, etc.). How is this possible? Please help me..

-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){ }]; UITableViewRowAction *flagAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Flag" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){ }]; UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){ // [self.objects removeObjectAtIndex:indexPath.row]; }]; return @[deleteAction,flagAction,moreAction]; } 
+5
source share
1 answer

I know this is far from ideal, but I added an empty string for the title

 [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@" " 

and then I used images

 block.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"block"]]; 

enter image description here

+1
source

Source: https://habr.com/ru/post/1204645/


All Articles