在我的旧应用程序中,我可以通过执行以下操作来完全禁用选项卡栏 Controller 中的重新排列 View :
tabBarController.customizedViewControllers = [NSArray arrayWithObjects:nil];
但在 iOS4 上,编辑按钮仍然显示,尽管它不显示任何项目。不是可以完全隐藏编辑按钮吗?
最佳答案
在app delegate.m文件中添加以下函数;
/* code to remove edit button in more view */
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
UINavigationBar *morenavbar = navigationController.navigationBar;
UINavigationItem *morenavitem = morenavbar.topItem;
/* We don't need Edit button in More screen. */
morenavitem.rightBarButtonItem = nil;
}
关于iphone - 在标签栏 Controller 的 "more" View 中禁用编辑按钮在 iOS4 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3279464/