【问题标题】:Setting custom color on UINavaigationBar在导航栏上设置自定义颜色
【发布时间】:2016-02-06 10:39:10
【问题描述】:

是否可以使用特定的不透明度和 alpha 设置 UINavigationBar 的颜色?我已经尝试了很多东西,但我仍然无法得到我想要的东西。 RGB 的颜色为 7、4、43,不透明度和 alpha 的颜色为 0,4。

【问题讨论】:

    标签: objective-c xcode uinavigationbar


    【解决方案1】:

    我认为这应该适合你:

    [navigationBar setBarTintColor:[UIColor colorWithRed:7.0/255.0 green:4.0/255.0 blue:43.0/255.0 alpha:0.4]];
    

    在 Swift 中:

    navigationBar.barTintColor = UIColor(red: 7.0, green: 4.0, blue: 43.0, alpha: 0.4)
    

    【讨论】:

    • 但是如何处理不透明度?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-12-21
    • 1970-01-01
    • 1970-01-01
    • 2012-09-17
    • 2020-09-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多