Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的应用程序中暂时隐藏状态栏。我希望它始终显示,但有时我想隐藏它。
我试过这个:
- (BOOL)prefersStatusBarHidden { return YES; }
但是一旦调用此方法,我将无法更改状态栏的状态。它是否存在在需要时隐藏或显示状态栏的东西?
谢谢
你可以打电话setNeedsStatusBarAppearanceUpdate。
setNeedsStatusBarAppearanceUpdate