The background color for my view in RGB format is R: 111/255 G: 209/255 B: 229/255

I tried setting the tint of the UIBarButtonItem using:

CGFloat nRed=111.0/255.0;
CGFloat nGreen=209.0/255.0;
CGFloat nBlue=229/255.0;
UIColor *myColor=[[UIColor alloc]initWithRed:nRed green:nBlue blue:nGreen alpha:1];
[[UIBarButtonItem appearance] setTintColor:myColor];

The color does change for all the UIBarButtonItems I have in the project...but it is still noticeably different from the color of my background. Any thoughts?

有帮助吗?

解决方案

You don't need to call the appearance method. Just do this:

//Suppose you have a variable barButtonItem
barButtonItem.tintColor = [UIColor blueColor];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top