我有 rootViewController - UINavigationController
。如你所知UINavigationController
。UINavigationBar
在 iOS 7UINavigationBar
中可以使用 barPosition topAttached。我想通过单击按钮来隐藏 ON/OFF 状态栏。但我也希望它UINavigationBar
应该始终是 barPositionTopAttached。
- (BOOL)prefersStatusBarHidden {
return __statusBarHidden;
}
- (IBAction)tapShowPhotosButton:(id)sender {
__statusBarHidden = !__statusBarHidden;
[self setNeedsStatusBarAppearanceUpdate];
}
现在从顶部UINavigationBar
更改,依此类推。barPosition
topAttached