ios - 在ios标签栏中禁用编辑按钮

标签 ios ios7 uitabbarcontroller

我知道这是一个老问题,但我无法解决。我在 Storyboard中制作了一个带有七个选项卡项的 Tabbar Controller ,而选项卡栏 Controller 不在自定义选项卡栏中,因此,我想在选项卡栏的更多部分隐藏一个编辑按钮。

为此我编码为:

 on application didFinishLaunchingWithOptions: method

_tabbarconroller.customizableViewControllers=[NSArray arrayWithObjects:nil];

同时添加一个方法

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{

    UINavigationBar *morenavbar = navigationController.navigationBar;
    UINavigationItem *morenavitem = morenavbar.topItem;

    morenavitem.rightBarButtonItem = nil;
}

但它在 iOS7 中不起作用请给我答案或任何资源,

最佳答案

使用 UITabBarController 的 customizedViewControllers property 使其成为 nil :

yourTabBarController.customizableViewControllers = nil;

关于ios - 在ios标签栏中禁用编辑按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26215918/

相关文章:

ios - 设计IOS标签栏的自定义图标

ios - tabbarcontroller下tableview最后一行被截断

ios - Cocoapods:创建一个包含核心数据的库。但不要获取核心数据实体

ios - "facebook login_sucess.html"未通过 iOS 中的 Graph API 提供访问 token

iphone - iOS 7 更新对我的应用的影响

ios - 删除 UITableView 中单元格前的空白

ios - UITabBarController 和使用 transitionFormViewController :

javascript - 如何使用 JavaScript 判断应用程序是否安装在 ios 设备上?

ios - 选择任何网站时如何在 xcode 的文本字段中加载 URL?

iphone - iOS 7 UIButton 的 Voiceover 问题