UINavigationBar background color not the exact UIColor I set it to

前端 未结 12 1579
天命终不由人
天命终不由人 2020-12-14 00:16

Please look at the screenshot below.

I set all the tint colors from the same UIColor object for the UINavigationBar, search bar and toolbar at the bottom. But for so

12条回答
  •  执笔经年
    2020-12-14 00:38

    I've tried every solution, mentioned in the answers here. But nothing solved it completly. I found this:

    First of all you have to have to select the navigationbar and disable the Translucent Checkbox. It's right at the top.

    After this is done. The BackgroundColor is still wrong. So don't set the BackgroundColor, set the TintColor of the NavBar. You can do this on the same way like the Translucent. The possibility to set the TintColor is 2 elements under the Translucent Checkbox.

    Or you set it using swift or objC:

    self.navigationController?.navigationBar.isTranslucent = false  
    navBar.barTintColor = UIColor.CustomColor.colorPrimary
    

提交回复
热议问题