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

前端 未结 14 998
伪装坚强ぢ
伪装坚强ぢ 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:08

    I have performed following steps and they worked for me quite well, should be working in iOS 8+ as well.

    1) Added property View controller-based status bar appearance => NO in Info.plist.
    2) Add following piece of code in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions of AppDelegate.m

        [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
        [self.window setBackgroundColor:[UIColor redColor]]; // Change color as per need.
    

    3) Override method in ViewController

    - (UIStatusBarStyle) preferredStatusBarStyle {
        return UIStatusBarStyleLightContent;
    }
    

提交回复
热议问题