[英]iPhone 5/SE show white statusbar, iPhone 6/7 show black statusbar
I was using [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
我正在使用
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
before, which was working fine, but is deprecated in iOS 9.0. 之前,它工作正常,但在iOS 9.0中已弃用。
Following this: 按照此:
UIApplication.sharedApplication().setStatusBarStyle() deprecated in iOS 9 UIApplication.sharedApplication()。在iOS 9中不推荐使用setStatusBarStyle()
in the project settings under "Deployment Info" I selected "Light" as "Status Bar Style". 在“部署信息”下的项目设置中,我选择“Light”作为“状态栏样式”。 Checking my Info.plist file, I also have "View controller-based status bar appearance" set to NO.
检查我的Info.plist文件,我还将“查看基于控制器的状态栏外观”设置为NO。
Now the "small" iPhones 5S/SE will correctly show a white statusbar, but iPhone 6(+)/7(+) will show a black statusbar. 现在“小”iPhone 5S / SE将正确显示白色状态栏,但iPhone 6(+)/ 7(+)将显示黑色状态栏。
How can I fix this? 我怎样才能解决这个问题?
[solved] [解决了]
Actually, after finding this: Status Bar showing black text, only on iPhone 6 iOS 8 simulator 实际上,找到这个: 状态栏显示黑色文本,仅在iPhone 6 iOS 8模拟器上
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.
我不得不为非工作iphone型号或者我现在所做的启动图像,使用启动故事板。 Now everything is white statusbar.
现在一切都是白色状态栏。
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. 我认为你必须继续你的项目常规设置并设置状态栏样式指示灯,然后转到info
Info.plist
文件并将“View controller-based status bar appearance”设置为NO。 if it will not work than you have to make object of UIStatusbar in ViewControllers like this. 如果它不起作用,你必须像这样在ViewControllers中创建UIStatusbar的对象。
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
Call preferredStatusBarStyle
in view did load. 在视图中调用
preferredStatusBarStyle
加载。
For Swift. 对于斯威夫特。
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
For Objective c 对于目标c
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
Using Xcode 使用Xcode
1.Go to Project ==> Target . 1.转到项目 ==> 目标 。
2.Set Status Bar Style to Light . 2.将状态栏样式设置为Light 。
3.Set View controller-based status bar appearance equal to NO in Info.plist . 3.在Info.plist中设置 基于控制器的状态栏外观等于 NO 。
Actually, after finding this: Status Bar showing black text, only on iPhone 6 iOS 8 simulator 实际上,找到这个: 状态栏显示黑色文本,仅在iPhone 6 iOS 8模拟器上
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.
我不得不为非工作iphone型号或者我现在所做的启动图像,使用启动故事板。 Now everything is white statusbar.
现在一切都是白色状态栏。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.