iphone - 在标签栏 Controller 的 "more" View 中禁用编辑按钮在 iOS4 中不起作用

标签 iphone ios4

在我的旧应用程序中,我可以通过执行以下操作来完全禁用选项卡栏 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/

相关文章:

iphone - 在数组中搜索字符串,然后在iphone中的textview中显示

iphone - 隐藏键盘

ios - 运行 iOS 8.2 的 ipad 中不显示相机

iphone - UIView.subviews 和 [NSView subviews] 之间的行为差​​异

iphone - 如何在 iphone 应用程序中实现 activesync 协议(protocol)?

ios - 从 NSMutableDictionary 中获取对象并将其显示在 UITableView 中

某些用户的 iOS 应用程序崩溃

objective-c - 如何为类编写正确的描述方法?

iphone - 应用程序进入后台后继续下载

iphone - 如何在iPhone SDK中为pickerview设置setInputAccessoryView