Iphone – Navigation bar back button color

iphone

I am unable to change the color of navigation bar back button. Any help? I customized the UINavigationBar class but I'm unable to change the back button color.

UINavigationBar class code

#import 
#import "UINavigationBar.h"

@interface UINavigationBar ( Category )
{

}

.m file code

- (void) drawRect:(CGRect)rect 
{

    [[UIImage imageNamed:@"top.png"] drawInRect:rect];
    self.tintColor = [UIColor colorWithRed:38 green:65 blue:82 alpha:1];    
}

I'm not able to change the color of the back button.

Best Answer

Using this you can change the color of all of the navigation buttons:

[[UIBarButtonItem appearance] setTintColor:[UIColor redColor]];

Replace redColor with the following to adjust the color of the buttons:

colorWithRed:0/255.0 green:144/255.0 blue:200/255.0 alpha:1.0// pick your color using this.

Note: Available for iOS 5 and >

Related Topic