0

Hello,

I created UINavigationBar, and I try to change the color bar to aqua color (As in Nib file)

How do I do it?

5 Answers 5

8
[[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:0 green:.62 blue:.984 alpha:1]];

Dude, try this to get [UIColor Aqua] throughout your app.

Sign up to request clarification or add additional context in comments.

Comments

1

You can set either tintColor or backgroundImage to your UINavigationBar

- (void) viewDidLoad
{
   //set background image
   [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"background.png"]];

  //OR set background Color
  [self.navigationController.navigationBar setTintColor:[UIColor blueColor]];
}

I'm not sure but if you'll put this in first call method of your app it may apply everywhere!

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { }

3 Comments

I try with the code [self.navigationController.navigationBar setTintColor:[UIColor blueColor]]; and code [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:1.0] but the blue is darker than aqua. And I can not reach to aqua color
@user1669223, You should find the color code for AQUA (RGB). Use mac in-built DigitalColor Meter and hover the cursor from which you want RGB and set the color code. You've to set RGB like, e.g. 125.0/255.0
The RGB for Aqua color is 255 blue 128 green 0 red but is light blue not aqua
0
UINavigationBar *bar = [self.navigationController navigationBar];
[bar setTintColor:[UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:1.0]];

Please try above code for set color.

Edited

 UINavigationBar *bar = [self.navigationController navigationBar];
UIColor* aqua = [UIColor colorWithRed:0 green:1 blue:1 alpha:1];
[bar setTintColor:aqua];

This Code use for the aqua color

2 Comments

I can not reach to aqua color this that's the problem
@user1669223 "I can not reach to aqua color this that's the problem" This is not a designers q&a. If your only problem is that you can't create aqua color using RGB, you should go to Photoshop and experiment. You shouldn't ask here how to create it
0

try this,

UINavigationController *navigationController;
UIColor* aqua = [UIColor colorWithRed:0 green:1 blue:1 alpha:1];
navigationController.navigationBar.tintColor = [UIColor aqua];

regards

Comments

-1
[self.navigationController.navigationBar setTintColor:[UIColor blueColor]];

Call this function befor the ViewController will appear, e.g. in viewDidLoad:

2 Comments

please make sure that you answer is to the question, otherwise you will get down vote, for your attention, im not the one who voted down here
My answer isn't wrong. If you read the question, it's not clear if the problem is, how to set the navigationbar color or just how to get the color aqua.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.