Hide the status bar in ios 9

后端 未结 7 2201
小鲜肉
小鲜肉 2020-12-02 18:36

How do you hide the status bar in ios 9?

This is now deprecated:

 [UIApplication sharedApplication] setStatusBarHidden:YES];
7条回答
  •  独厮守ぢ
    2020-12-02 19:28

    An easy approach would be to set the windowLevel of the Application to be either normal or statusBar based on your needs, so to start

    Objective-C

    To Hide the Status Bar

     UIApplication.sharedApplication.keyWindow.windowLevel = UIWindowLevelStatusBar;
    

    To Show the Status Bar

     UIApplication.sharedApplication.keyWindow.windowLevel = UIWindowLevelNormal;
    

    Also add the Key (View controller-based status bar appearance) with boolean value NO.

提交回复
热议问题