有什么办法可以隐藏“-"?编辑 UITableView 时的(删除)按钮 [英] Is there any way to hide "-" (Delete) button while editing UITableView
本文介绍了有什么办法可以隐藏“-"?编辑 UITableView 时的(删除)按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的 iphone 应用程序上,我有一个处于编辑模式的 UITableView,在该模式下,用户只能重新排序行,没有删除权限.
On my iphone app, I have a UITableView in edit mode, where user is allowed only to reorder the rows no delete permission is given.
那么有什么办法可以隐藏 TableView 中的-"红色按钮.请告诉我.
So is there any way where I can hide "-" red button from TableView. Please let me know.
谢谢
推荐答案
这是我的完整解决方案,单元格没有缩进(0left align)!
Here is my complete solution, without indentation (0left align) of the cell!
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{
return UITableViewCellEditingStyleNone;
}
- (BOOL)tableView:(UITableView *)tableview shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {
return NO;
}
- (BOOL)tableView:(UITableView *)tableview canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
这篇关于有什么办法可以隐藏“-"?编辑 UITableView 时的(删除)按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文