【问题标题】:How to include and set launch screen status bar color?如何包含和设置启动屏幕状态栏颜色?
【发布时间】:2016-01-20 07:25:20
【问题描述】:

我是 ios 8/9 中启动屏幕的新手。我创建了一个 (LaunchScreen.storyboard) 并添加了一个带有背景颜色的导航栏。我希望包含状态栏并使用相同的颜色。

通常我会在显示状态栏并隐藏文本的单个模拟器设备上截取屏幕截图。我已经阅读了一些资源herehere,但这没有涉及。我能做什么?

【问题讨论】:

    标签: ios iphone ios8 storyboard launch-screen


    【解决方案1】:

    进入项目目标设置 设置statusbarstyle:gray

    并且还在 appdelegate.m 中设置

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  
    
        // For change Statusbar Color ios 9.0
        application.statusBarStyle = UIStatusBarStyleLightContent;
        return YES;
    }
    

    【讨论】:

      【解决方案2】:

      如果要在启动屏幕中显示状态栏,请在 info.plist 中添加以下属性

      状态栏最初是隐藏的 NO

      对于 XML 编辑器 ~ 添加到

      的第一个子级
      <key>UIStatusBarHidden</key>
      <false/>
      

      它将以与导航栏相同的背景颜色显示。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-11-14
        • 1970-01-01
        • 2016-03-06
        • 2020-06-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多