简体   繁体   中英

UINavigationBar background color not appearing as solid color

I'm trying to change the background color of statusbar and UINavigationBar Using appDeligate file but somehow changed color does not appear as Solid color it is appearing with some gradient from the start please refer to below image iOS APP UINavigationBar颜色 this what i have declared in AppDelegate in didFinishLaunchingWithOptions function

UINavigationBar.appearance().backgroundColor = UIColor(red: 159/255, green: 31/255, blue: 99/255, alpha: 100)
UINavigationBar.appearance().tintColor = UIColor.white
UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white] 

This what I have declared in my plist file 我的plist文件
Please help me out here I tried all searching everywhere but could not find any solution

Thank you, everyone, after being looking for answer to change the tabbar color I found the answer to this question earlier my my AppDelegate was .

UINavigationBar.appearance().backgroundColor = UIColor(red: 159/255, green: 31/255, blue: 99/255, alpha: 100)
UINavigationBar.appearance().tintColor = UIColor.white
UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white] 

Now I changed this to

UINavigationBar.appearance().barTintColor = UIColor(red: 159/255, green: 31/255, blue: 99/255, alpha: 100)
UINavigationBar.appearance().tintColor = UIColor.white
UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white] 

and my problem was solved

检查栏样式颜色的半透明属性。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM