我知道这是一个老问题,但我无法解决。我在 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/