Hiding status bar iOS 7

前端 未结 5 729
我寻月下人不归
我寻月下人不归 2020-12-05 00:17

Can\'t hide status bar on view controller on ios 7 device.

Already tried setting through plist file and also in Appcontroll

相关标签:
5条回答
  • 2020-12-05 01:07

    For iPad (iOS 7.0) need to put another value at Info.plist file.

    UIStatusBarHidden boolean value YES.

    0 讨论(0)
  • 2020-12-05 01:13

    That's because iOS 7 has changed the way it deals with the status bar.

    Setting UIViewControllerBasedStatusBarAppearance to NO on your app Info.plist should work.

    0 讨论(0)
  • 2020-12-05 01:16

    Go to info.plist and add two attributes if not present. set "Status bar is initially hidden" to YES and set UIViewControllerBasedStatusBarAppearance to NO. This will hide status bar for your app.

    0 讨论(0)
  • 2020-12-05 01:18

    I had the same issue recently. Be sure that you are targeting the correct view controller. Try to hide the status bar in the root view controller. Also, I´m implementing the method (BOOL)prefersStatusBarHidden (doc) in my UIViewControllers to hide the status bar. By using this method, you can forward the preferred configuration to a "child view controller". Also, this method works fine in UIViewControllers presented as modal.

    0 讨论(0)
  • 2020-12-05 01:18
    // for ios 7 
    - (BOOL)prefersStatusBarHidden
    {
        return YES; 
    }
    
    
    // for ios 6
    - (void)viewWillAppear:(BOOL)animated 
    {
        [super viewWillAppear:animated];
        [[UIApplication sharedApplication] setStatusBarHidden:YES]; 
    }
    
    0 讨论(0)
提交回复
热议问题