Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default color for navigation bar buttons on the iPhone?

I'm adding a segmented control to a navigation bar in my iPhone app. By default the color of the segmented control matches the color of the navigation bar. I want to match the color of the segmented control to other buttons in the navigation bar (like the back navigation button).

Can anyone tell me an RGB value (or a system color) that matches the default color of UIButtonBarItems that have been added to a UINavigationBar with a style of UIBarStyleDefault?

like image 870
ceperry Avatar asked May 25 '09 02:05

ceperry


People also ask

What color should the navigation bar be?

By default, your top navigation bar's background color will be white. For aesthetic preferences or to better contrast your logo's colors, you may want to change this.

What is iPhone navigation bar?

A navigation bar appears at the top of an app screen, below the status bar, and enables navigation through a series of hierarchical app screens. When a new screen is displayed, a back button, often labeled with the title of the previous screen, appears on the left side of the bar.

Can you change iPhone navigation bar?

Change the Bar StyleA user changes the navigation bar's style, or UIBarStyle , by tapping the “Style” button to the left of the main page. This button opens an action sheet where users can change the background's appearance to default, black-opaque, or black- translucent.


2 Answers

After a while, I realized that the iPhone was applying a blue gradient to the button, so the tint needed to be pretty gray. I finally hit on this HSV combination which is pretty darn perfect. Note that as per the documentation, all values are specified as float values between 0 and 1.

Hue: 0.6

Saturation: 0.33

Value: 0.69

Alpha: 0

I hope this saves a couple hours of work for some other developer.

like image 85
ceperry Avatar answered Oct 12 '22 22:10

ceperry


Set the tint color like so:

self.navigationController.navigationBar.tintColor = nil

It will give you the default color and the gradient shade as well.

like image 33
DataPriest Avatar answered Oct 12 '22 22:10

DataPriest