Change the status bar background color color past iOS 7

前端 未结 8 1313
既然无缘
既然无缘 2020-12-30 04:02

I want to change background color of status bar on iOS 7, and I\'m using this code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOp         


        
8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-30 04:52

    In iOS 7 and later, the status bar is transparent. Set the backgroundColor of your view to the color you want for the status bar.

    Or, you can add a 20px-high subview with red color at the top of your view.

    See the Apple Transition Guide for more.

    Also, make sure that your preferredStatusBarStyle is UIStatusBarStyleLightContent. and in your Info.plist set "View controller-based status bar appearance" to "NO".

提交回复
热议问题