我正在构建一个iOS 9
带有horizontal
页面导航的应用程序,需要在某些页面上显示状态栏,并将其隐藏在其他页面上.我想使用淡入/淡出动画,所以我必须设置
View controller-based status bar appearance = NO
并像这样更新状态栏:
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
在页面之间导航时,此过程非常有效,但我无法在启动时删除状态栏.
我试过设置: Status bar is initially hidden = YES
将此添加到 NavigationControllers viewDidLoad:
[[UIApplication sharedApplication] setStatusBarHidden:YES]; self.statusBarHidden = YES; [self setNeedsStatusBarAppearanceUpdate];
将此添加到AppDelegates didFinishLaunchingWithOptions:
application.statusBarHidden = YES;
将其添加到初始页面的ViewController:
- (BOOL)prefersStatusBarHidden { return YES; }
检查General-> Deployment Info中的"隐藏状态栏"选项
并在链接的storyboard元素中将"状态栏"设置为"无"
但状态栏仍然在发布时出现.如何在不改变值的情况下摆脱启动时的状态栏View controller-based status bar appearance
?