【问题标题】:how to increase the height of navigation bar and change the color of status bar in xcode 8 using swift3?如何使用swift3增加导航栏的高度并更改xcode 8中状态栏的颜色?
【发布时间】:2017-05-01 15:05:03
【问题描述】:

我想改变导航栏的高度,以便在其中添加搜索栏字段。由于导航栏的背景颜色是紫色,我想将状态栏(屏幕顶部的数据载体、日期和电池小部件)的颜色更改为白色而不是黑色。谢谢

【问题讨论】:

    标签: ios swift


    【解决方案1】:

    您应该看看这个示例应用,因为它解释了如何修改 UINavigationBar。

    https://developer.apple.com/library/content/samplecode/NavBar/Introduction/Intro.html

    要将状态栏更改为白色,请将其添加到您的 ViewController。

    override var preferredStatusBarStyle: UIStatusBarStyle {
    
        return .lightContent
    }
    

    【讨论】:

      猜你喜欢
      • 2015-05-07
      • 1970-01-01
      • 1970-01-01
      • 2022-01-20
      • 2015-11-03
      • 1970-01-01
      • 1970-01-01
      • 2014-02-02
      • 1970-01-01
      相关资源
      最近更新 更多