Reputation: 3206
I was using [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
before, which was working fine, but is deprecated in iOS 9.0.
Following this:
UIApplication.sharedApplication().setStatusBarStyle() deprecated in iOS 9
in the project settings under "Deployment Info" I selected "Light" as "Status Bar Style". Checking my Info.plist file, I also have "View controller-based status bar appearance" set to NO.
Now the "small" iPhones 5S/SE will correctly show a white statusbar, but iPhone 6(+)/7(+) will show a black statusbar.
How can I fix this?
[solved]
Actually, after finding this: Status Bar showing black text, only on iPhone 6 iOS 8 simulator
I was able to work it out. I had to put either launch images for the non-working iphone models, or what I now did, use a launch storyboard. Now everything is white statusbar.
Upvotes: 1
Views: 243
Reputation: 3206
Actually, after finding this: Status Bar showing black text, only on iPhone 6 iOS 8 simulator
I was able to work it out. I had to put either launch images for the non-working iphone models, or what I now did, use a launch storyboard. Now everything is white statusbar.
Upvotes: 1
Reputation: 2547
For Swift.
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
For Objective c
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
Using Xcode
1.Go to Project ==> Target.
2.Set Status Bar Style to Light.
3.Set View controller-based status bar appearance equal to NO in Info.plist.
Upvotes: 1
Reputation: 45
I think you have to go on your project general setting and set the status bar style light and than go to info Info.plist
file and set "View controller-based status bar appearance" set to NO. if it will not work than you have to make object of UIStatusbar in ViewControllers like this.
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
Call preferredStatusBarStyle
in view did load.
Upvotes: 1