Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the Transparent statusbar in iphone

In my application i want to set the statusbar transparent.There are three styles are possible for changing the style of the statusbar.

  1. gray
  2. black
  3. black translucent

mycode:

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];

How to set the transparent statusbar?

like image 381
kanmani Avatar asked Feb 16 '11 13:02

kanmani


2 Answers

The best solution for this problem is to set self.wantsFullScreenLayout = YES; in your view controller and [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; for your status bar.

UPDATE:

As Mihir Oza told in comments the UIStatusBarStyleBlackTranslucent constant from old version of my answer is now deprecated. Use UIStatusBarStyleLightContent instead.

like image 157
Anton Ogarkov Avatar answered Oct 07 '22 18:10

Anton Ogarkov


For the global app in the info.plist add Status bar style: Transparent Black Style (alpha 0.5).

like image 23
Mihaela Mates Avatar answered Oct 07 '22 18:10

Mihaela Mates