When hiding the statusbar my navigation bar moves up in iOS7

前端 未结 5 604
逝去的感伤
逝去的感伤 2021-01-31 16:05

I am trying to hide the statusbar but maintain the \"bigger\" navigationbar height. Right now when I hide the statusbar by setting - (BOOL)prefersStatusBarHidden to

5条回答
  •  自闭症患者
    2021-01-31 17:01

    You can create a custom UIView with its frame as

    customView.frame=CGRectMake(0, 20, self.view.frame.size.width, self.view.frame.size.height);
    

    Also hide your status bar by following the below steps

    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.

提交回复
热议问题