I am using following code for swipe UITableViewCell in xcode6 with ios8.0.My code is working fine,but i need to set equal width for UITableViewRowActions (more,Delete,etc).How is that 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];
}
I know that It's way far from perfect but I added empty string for the title
[UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@" "
and then I used images
block.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"block"]];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With