4

I'm trying to get the standard black translucent status bar in my iOS (iOS 6) app programmatically with no luck. I tried adding the key/value in my info.plist, as well as adding...

[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleBlackTranslucent];

...to no effect. What else could be causing this?

w5m
  • 2,286
  • 3
  • 34
  • 46
jfisk
  • 6,125
  • 20
  • 77
  • 113

4 Answers4

6

Thank you everyone for your input! You can set it in the info.plist, or use

[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleBlackTranslucent];

Turns out it was translucent - there was just nothing underneath. What i was missing was this line in my view controller

self.wantsFullScreenLayout = YES;

and thats it!

jfisk
  • 6,125
  • 20
  • 77
  • 113
4
  1. Delete that line of code.
  2. Click on the project file in the project navigator.
  3. Select your target.
  4. Go to "Summary" tab.
  5. Select the status bar style from the drop down.
Fogmeister
  • 76,236
  • 42
  • 207
  • 306
  • i have a question with a bounty and i have a proto type project on git hub for that question. would you mind taking a look at it. i have the saving the string part answered but i cant get the answer for saving the images. ill be grateful for any help. adrian – Adrian P May 15 '13 at 17:03
0

Have a look at my answer to this question.

Basically you can change the statusBar in the project summary. Here you can select Status Bar Style Black Transculent from the drop down menu.

Community
  • 1
  • 1
pmk
  • 1,897
  • 2
  • 21
  • 34
0

you have got the code right. place it in your app delegate in application did finish launching with an option and it should do the trick. i just built a simple view application and just added your code to the app delegate and added an image to the view to test it and it works. you can see it in screen shot below.

enter image description here

good luck.

Adrian P
  • 6,479
  • 4
  • 38
  • 55
  • i beg the differ sir. i just placed the code snippet in the right place which is in app delegate rather than view did load that he was applying. the code is right the place was wrong. and i disagree with your statement respectfully because i have offered a screen shot to support my answer. i believe it is a polite way to prove a point. – Adrian P May 15 '13 at 16:25