ios - hidesBottomBarWhenPushed 在 iOS 7 中被忽略

标签 ios uinavigationcontroller uitabbarcontroller ios7

此代码在 iOS 7 发布之前一直运行良好。我正在分配一个 UIViewControllerhidesBottomBarWhenPushedYES,作为 UINavigationController< 的 rootViewController/。但无论如何都会显示 TabBar。相关代码如下:

Login *lv = [[Login alloc] init];
lv.HowToUseShows = showHowToUse;
lv.hidesBottomBarWhenPushed = YES;

UINavigationController *BokShelfNav = [[UINavigationController alloc] initWithRootViewController:lv];

//... 

UITabBarController *tbController = [[UITabBarController alloc] init];
tbController.viewControllers = @[BokShelfNav,...];

谁有类似的问题?

最佳答案

我发现调用方法和设置属性的顺序会影响标签栏是否显示。

如果我将 self.hidesBottomBarWhenPushed = YES; 放在 View Controller 的 viewDidLoad 方法中,我正在推送标签栏仍然显示。如果我将其移至 init 方法,标签栏将像在 iOS 6 上一样隐藏。

关于ios - hidesBottomBarWhenPushed 在 iOS 7 中被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19047747/

相关文章:

ios - 在 viewDisappear 之前等待 saveInBackground Parse

ios - 如何在 swift 4 中制作带有多行 itemTitle 的 UITabBar

ios - 从 swift 为 objective-c 变量赋值

objective-c - 当 tabBarController/navController 在同一应用程序中时推送到详细 View 时出现问题

ios - 推送 Segue 动画停止工作

ios - 三个 View Controller 之间的导航,其中所有三个 View Controller 都在一个标签栏 View 中

ios - 无法设置 UIViewController 导航栏的颜色

ios - 在 UITabbar 中拉伸(stretch)的标签栏图标

iphone - 横向模式下的 tabBarController 和 navigationControllers,第二集

ios - subview 宽度 anchor 在 stackView 中不起作用