I need a transparent status bar as shown in the image below.
I tried this,
UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
statusBar.backgroundColor = [UIColor clearColor];
}
But this basically gives the same result as UIStatusBarStyleLightContent.
By default, status bar has transparent background, you just need to extend frame of your image, behind status bar.
Here is test snapshot for you. I've set UIImageView with red background color and custom image.