1

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?

4

1 回答 1

0

您不需要调用该appearance方法。只需这样做:

//Suppose you have a variable barButtonItem
barButtonItem.tintColor = [UIColor blueColor];
于 2012-07-19T21:59:54.313 回答