As you said the only things you can change on the action are:
- backgroundColor
- style (destructive (red backgroundcolor, ...)
- title
In order to change the style of the UITableViewRowAction is the probable solution is adding the image using 'patternimage'.
Here is the solution for this.And I am not saying this is the exact solution, because as now we not have access to all the properties of the 'UITableViewRowAction'
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"test" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
// show UIActionSheet
}];
float wwidth =[moreAction.title sizeWithAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"Helvetica" size:15.0]}].width;
wwidth = wwidth+<55 change this value for exact width>;
moreAction.backgroundColor = [[UIColor alloc] initWithPatternImage:[self imageWithImage:[UIImage imageNamed:@"temp.jpg"] scaledToSize:CGSizeMake(wwidth, tableView.rowHeight)]];
UITableViewRowAction *flagAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Flag" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
// flag the row
}];
flagAction.backgroundColor = [UIColor yellowColor];
return @[moreAction, flagAction];
}
Note: use the High resolution image so that it works for
iPhone 6 Plus 736x414 points 5.5"
iPhone 6 667x375 points 4.7"
iPhone 5 568x320 points 4.0"
iPhone 4 480x320 points 3.5"
Useful post on this link http://pablin.org/