有什么办法隐藏“ - ” (删除)按钮 [英] Is there any way to hide "-" (Delete) button while editing 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.
感谢
推荐答案
这是我的完整解决方案,
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;
}
这篇关于有什么办法隐藏“ - ” (删除)按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文