I am using iOS 5 and changing the color of the UIBarButton by using this code:
[[UIBarButtonItem appearance] setTintColor:[UIColor colorWithRed:76/255.0 green:120/255.0 blue:181/255.0 alpha:1.0]];
I want them to be another color in some views though (1 color in navbar, 1 color when in toolbar).
Is this possible?
Yep, you can use the
+appearanceWhenContainedIn:method:That way the tint color of
UIBarButtonItemswill only be affected when they’re embedded inside aUINavigationBar.