1

In my project I able to hide status bar on iPhone.

But it doesn’t work for my iPad How can I hide Status Bar on my iPad?

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
user
  • 21
  • 1
  • 3

3 Answers3

4

you should override the method,

-(BOOL)prefersStatusBarHidden{
    return YES;
}

in every viewcontroller if you have not making setting in info.plist for hiding it.

if you want to manage in info.plist then,

<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

You can check the screenshot below

enter image description here

screenshot reference : this so answer, you can refer this post also btw.

Charlie Fish
  • 18,491
  • 19
  • 86
  • 179
Ketan Parmar
  • 27,092
  • 9
  • 50
  • 75
4

Objective C:

- (BOOL)prefersStatusBarHidden{
 return YES;
}

Swift 4:

override var prefersStatusBarHidden: Bool {
 return true
}
Zouhair Sassi
  • 1,403
  • 1
  • 13
  • 30
0

I have the same question, and I have set info.plist with what Charlie Fish showed, but it's not help.

I fixed by changing TARGETS->Deployment info->Devices to iPad, then run Xcode.

AZZ
  • 55
  • 9