Status Bar showing black text, only on iPhone 6 iOS 8 simulator

前端 未结 14 1027
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 20:16

I\'m trying to convert my iOS 7 app to iOS 8 in Xcode 6 GM, and when i run it on the iPhone 5s or lower simulators with iOS 8 everything is fine, but on the iPhone 6 and 6 P

14条回答
  •  醉话见心
    2020-12-07 21:00

    I know it's bad style to override behaviour in a base class using a category, but this works and may be the quickest solution to fix it.

    Step #1: Ensure UIViewControllerBasedStatusBarAppearance or View controller-based status bar appearance is set to YES in your application plist file.

    Step #2: Add the following code to your project:

    @implementation UIViewController (StatusBarColorFix)
    
    - (UIStatusBarStyle) preferredStatusBarStyle {
        return UIStatusBarStyleLightContent;
    }
    
    @end
    

提交回复
热议问题