5

I have tried everything suggested here: Status bar won't disappear to no avail.

My iPhone version of my app has no status bar shown, but on my iPad, which runs the scaled up version of my iPhone version, there is a status bar that won't go away!

If it makes a difference, my app uses the devices camera for a majority of the app. If you need more info/code, don't hesitate to ask! My app is iOS 7 only, and I use Xcode 5. Also, I would like the status bar gone in the whole app.

Do not suggest UIViewControllerBasedStatusBar in the plist-- it does not work.


Related Articles

https://stackoverflow.com/a/18740897/294884

https://stackoverflow.com/a/21034908/294884

https://stackoverflow.com/a/20307841/294884

Community
  • 1
  • 1
Branch
  • 387
  • 5
  • 16
  • 1
    You know, this QA actually has a **lot of information** the others actually do not have. (Plus a hell of an argument started by Vike :) ) Actually it is perhaps a bad idea to close it. – Fattie Apr 13 '14 at 14:54
  • 1
    If you think you added something new and valuable, post it on another question, as tho every likely will be closed. – vikingosegundo Apr 13 '14 at 17:27
  • what Joe Blows calls argument was just the hint that the technique he uses is not supported and discouraged from Apple. It might work, it might fail. Joe Blow answered, that there are situations, where it is the only reasonable way, iE he usually deals with hundreds of custom view controller classes in each project. I say, if you got in such a situation your architecture is broken, as I usually don't use much more than half a dozen, maybe a flu dozen. but never hundreds. – vikingosegundo Apr 13 '14 at 20:25
  • And I repeat: If your got to a point, where using subclassing with categories is the only option, you are already on the wrong path for some time. At least for this question it is not needed at all. – vikingosegundo Apr 13 '14 at 20:26
  • just for anyone googling here, it is now 2017, (fortunately) the discussion above about categories etc is now totally gone from iOS. you simply add the two items in your plist, that's all there is to it. – Fattie Apr 11 '17 at 18:14

2 Answers2

3

For 2016 onwards all you do is:

Add these two items to your plist:

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

1. It is that simple

2. There is no other method.

(Note - there's a (pointless) "hide status bar" checkbox in "general settings" "deployment info" section. This simply reads the plist file, it's a completely pointless checkbox.)


Historic answers...

I've removed the historic answers as they are completely useless. (If any historians need to read it, click "edit history".)

Fattie
  • 27,874
  • 70
  • 431
  • 719
0

Have you already, on your info.plist file, added two new attributes if not present? Please try setting "Status bar is initially hidden" to "YES" and also set "UIViewControllerBasedStatusBarAppearance" to "NO". This will hide status bar for your app.

neowinston
  • 7,584
  • 10
  • 52
  • 83
  • As I said in the question I tried everything here: http://stackoverflow.com/questions/17763719/status-bar-wont-disappear (including your suggestion) to no avail. Thanks though! – Branch Apr 13 '14 at 13:14
  • 1
    Yup, in some cases "this just does not work". I don't think it's worth going in to why here, but that's life. I would go so far as to say i iOS7 you should not, ever, use UIViewControllerBasedStatusBarAppearance. it is **only** a legacy thing to try to make things work while everyone is "getting used to" iOS7/Xcode5. – Fattie Apr 13 '14 at 13:22