I'm attempting to make my navigation bar RGB(32,29,29) but when the app launches (currently working in the simulator with Xcode 5.0.2) it is rendered as RGB(42,38,38).

This is the color I want: 32,29,29

And this is the color I'm getting: 42,38,38

A subtle difference, but strange. Here's my appearance code in my AppDelegate.m:

application.statusBarStyle = UIStatusBarStyleLightContent;
[UINavigationBar appearance].tintColor = [UIColor whiteColor];
[UINavigationBar appearance].barStyle = UIBarStyleBlack;
[UINavigationBar appearance].barTintColor = [UIColor colorWithRed:32.0/255.0 green:29.0/255.0 blue:29.0/255.0 alpha:1.0];
[UITextField appearance].keyboardAppearance = UIKeyboardAppearanceDark;

I've tried variations of removing some of those settings to see if perhaps a tint was being applied, but so far I can't figure it out. What's going on?

有帮助吗?

解决方案

I've had things render a slightly different color in iOS before and it's frustrating. You can try setting the bar to be not translucent:

navigationController.navigationBar.translucent = NO;

It's worked for me in the past.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top