简体   繁体   中英

Navigation Bar color and a View's color

I'm getting a weird, i have a navigation bar and a view that is right under it.

I set both of them to [UIColor BlueColor], but at run time the outcome is that the nav bar has a slit darker color then the view.

Any knows what causes this? Thanks

Your problem is that the navigation bar is translucent, and therefore the bar color is put on top of the view's color, making it appear darker. Try making the bar not translucent.

navigationBar.translucent = NO;

You can try this one:--

navigationController.navigationBar.barTintColor = [UIColor greenColor];

or

[[UINavigationBar appearance] setBarTintColor:[UIColor greenColor]];

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