美文网首页
iOS设置状态栏、导航栏字体颜色为白色

iOS设置状态栏、导航栏字体颜色为白色

作者: Openwit | 来源:发表于2018-12-22 13:51 被阅读8次

状态栏:
在info.plist中添加如下配置:


屏幕快照 2018-12-22 下午1.49.22.png
屏幕快照 2018-12-22 下午1.49.32.png

导航栏:(swift4.2)

        UINavigationBar.appearance().barTintColor = [UIColor colorWithRed:0.612 green:0.345 blue:0.929 alpha:1.00] //主题色
        UINavigationBar.appearance().tintColor = UIColor.white
        UINavigationBar.appearance().isTranslucent = true
        let attributes = [
            NSAttributedString.Key.font: UIFont.systemFont(ofSize: 19.0),
            NSAttributedString.Key.foregroundColor: UIColor.white
        ]

        UINavigationBar.appearance().titleTextAttributes = attributes

相关文章

网友评论

      本文标题:iOS设置状态栏、导航栏字体颜色为白色

      本文链接:https://www.haomeiwen.com/subject/zeyikqtx.html