From what I remember, faced with a similar problem, the UINavigationBar will just take the tintColor and make it darker for the UIBarButtonItem (unless the style is set to BarStyleBlack, in which case it makes it gray gray).
To do what you ask, I would create a custom UIButton with background images for different control states that match your color scheme, and then use this UIButton as a view for the custom UIBarButtonItem.
UIButton *customButton = [UIButton buttonWithType:...]; //normal_button.png and selected_button.png need to be created by you [customButton setBackgroundImage: [UIImage imageNamed:@"normal_button.png"] forState:UIControlStateNormal]; [customButton setBackgroundImage: [UIImage imageNamed:@"selected_button.png"] forState:UIControlStateSelected]; UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView: customButton];
If you want to try and encapsulate this, you can always create a factory or your own init method in UIBarButtonItem (through the category) and use the code above (with a few changes).
I know that I am not fully addressing your second question on simply redefining the management status with a category. I donβt know which method to override in UIBarButtonItem to accomplish such a thing, but you can accomplish what you want with the swizzling method (http://cocoadev.com/index.pl?MethodSwizzling) as soon as you find out which method you want to exchange.
I should note that I only ever used swizzling for testing / debugging.
fjlksahfob
source share