Reputation: 145
I need give a custom color to my navigation bar.But I am not intended to use an image.Is there any way to change the navigation bar color other than using an image.Please help. Thanks in advance.
Upvotes: 2
Views: 3759
Reputation: 199
navBar.navigationBar.barTintColor = [UIColor blueColor];
// barTintColor sets the background color
navBar.navigationBar.tintColor = [UIColor whiteColor];
// tintColor sets the buttons color of the navigation bar
navBar.navigationBar.translucent = NO;
Upvotes: 2
Reputation: 445
In objective C and In IOS 7 navigation bar has a property
in your view controller.h file make a property of your navigationbar like this.
@property (weak, nonatomic) IBOutlet UINavigationBar *mynavbar;
And in your viewcontroller.m file call that this method change your navigationbar color.
mynavbar.barTintColor=[UIColor groupTableViewBackgroundColor];
thanks in advance.
Upvotes: 0
Reputation: 907
You can use RGB values to make a color and can set it to your navigation bar.
yourNavigationController.navigationBar.tintColor = [UIColor colorWithRed:0.31 green:0.66 blue:0.83 alpha:1.00];
Upvotes: 4