1、iOS9之后APP必须启用ATS,在info.plist添加

<key>NSAppTransportSecurity</key>
<dict>
	<key>NSAllowsArbitraryLoads</key>
	<true/>
</dict>

2、设置状态栏文本颜色为白色,在info.plist添加

<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

同时修改状态栏Style为Light,如下图:
iOS Objective开发基础知识点总结(持续更新...)
如果需要修改状态栏的背景颜色,在AppDelegate添加如下代码并调用:

- (void)setStatusBarBackgroundColor:(UIColor *)color {
    
    UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
    if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
        statusBar.backgroundColor = color;
    }
}

相关文章:

  • 2021-05-15
  • 2022-12-23
  • 2022-01-21
  • 2022-01-16
  • 2022-02-09
  • 2021-08-25
  • 2021-12-13
  • 2022-12-23
猜你喜欢
  • 2021-10-17
  • 2021-12-18
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
  • 2021-07-30
  • 2021-12-16
相关资源
相似解决方案