如何在iOS8.0中管理UITableViewRowAction的相等宽度?(更多,删除等动作) [英] How to manage equal width for UITableViewRowAction in iOS8.0?(More,Delete,etc actions)
本文介绍了如何在iOS8.0中管理UITableViewRowAction的相等宽度?(更多,删除等动作)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用以下代码在icode8.0的xcode6中滑动UITableViewCell。我的代码工作正常,但我需要为UITableViewRowActions设置相等的宽度(更多,删除等)。怎么可能?请帮帮我。 。
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:@" "
然后我使用图片
block.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"block"]];
这篇关于如何在iOS8.0中管理UITableViewRowAction的相等宽度?(更多,删除等动作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文