Questions tagged [uinavigationbar]

The UINavigationBar class implements a control for navigating hierarchical content in iOS. It’s a bar, typically displayed at the top of the screen, containing buttons for navigating up and down a hierarchy. The primary properties are a left (back) button, a center title, and an optional right button. You can specify custom views for each of these. The most common way to use a navigation bar is in conjunction with a UINavigationController object

A navigation bar enables navigation through an information hierarchy and, optionally, management of screen contents. A navigation bar is contained in a navigation controller, which is an object that manages the display of the hierarchy of custom views. A navigation bar appears at the upper edge of an application screen, just below the status bar.

A navigation bar usually displays the title of the current screen or view, centered along its length. When navigating through a hierarchy of information, users tap the back button to the left of the title to return to the previous screen. Otherwise, users can tap content-specific controls in the navigation bar to manage the contents of the screen.

All controls in a navigation bar include a bezel around them, which, in iOS (), is the bordered style. If you place a plain (borderless) control in a navigation bar, it automatically converts to the bordered style.

A navigation bar can be translucent or opaque. If the bar is translucent, the top edge of the main content view meets the bottom edge of the status bar, so that users can see the content behind the navigation bar. If the bar is opaque, the top edge of the main content view meets the bottom edge of the navigation bar.

On iPhone (), changing the device orientation from portrait to landscape can change the height of the navigation bar automatically. On iPad (), the height and translucency of a navigation bar does not change with rotation.

On iPhone, a navigation bar always displays across the full width of the screen. On iPad, a navigation bar can display within a view, such as one pane of a split view, that does not extend across the screen.

References:

6208 questions
535
votes
49 answers

How to hide UINavigationBar 1px bottom line

I have an app that sometimes needs its navigation bar to blend in with the content. Does anyone know how to get rid of or to change color of this annoying little bar? On the image below situation i have - i'm talking about this 1px height line…
Szymon Kuczur
  • 5,783
  • 3
  • 16
  • 14
328
votes
14 answers

How to hide a navigation bar from first ViewController in Swift?

How can I hide a navigation bar from first ViewController or a particular ViewController in swift? I used the following code in viewDidLoad(): override func viewDidLoad() { super.viewDidLoad() …
Vettiyanakan
  • 7,957
  • 6
  • 37
  • 55
312
votes
36 answers

Changing navigation bar color in Swift

I am using a Picker View to allow the user to choose the colour theme for the entire app. I am planning on changing the colour of the navigation bar, background and possibly the tab bar (if that is possible). I've been researching how to do this but…
user3746428
  • 11,047
  • 20
  • 81
  • 137
293
votes
24 answers

Creating a left-arrow button (like UINavigationBar's "back" style) on a UIToolbar

I'd love to create a "back" left-arrow-bezel button in a UIToolbar. As far as I can tell, the only way to get one of these is to leave UINavigationController at default settings and it uses one for the left bar item. But there's no way I can find to…
Marco
  • 14,977
  • 7
  • 36
  • 33
289
votes
32 answers

iPhone Navigation Bar Title text color

It seems the iOS Navigation Bar title color is white by default. Is there a way to change it to a different color? I am aware of the navigationItem.titleView approach using an image. Since my design skills are limited and I failed to get the…
Roby
252
votes
31 answers

Change color of Back button in navigation bar

I am trying to change the color of the Settings button to white, but can't get it to change. I've tried both of these: navigationItem.leftBarButtonItem?.tintColor = UIColor.whiteColor() navigationItem.backBarButtonItem?.tintColor =…
247
votes
20 answers

Make UINavigationBar transparent

How do you make a UINavigationBar transparent? Though I want its bar items to remain visible.
quano
  • 18,812
  • 25
  • 97
  • 108
238
votes
36 answers

UINavigationBar custom back button without title

How can I customize the navigation back button in iOS 7 and above without title? (i.e. with the arrow only) self.navigationItem.leftBarButtonItem = self.editButtonItem; I'm just wondering if they have any self.backButtonItem; OR something like…
Kiddo
  • 5,052
  • 6
  • 47
  • 69
235
votes
11 answers

iOS 7 Navigation Bar text and arrow color

I want to set background for Navigation Bar to be black and all colors inside it to be white. So, I used this code : [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], …
1110
  • 7,829
  • 55
  • 176
  • 334
227
votes
37 answers

How do I change the title of the "back" button on a Navigation Bar

Currently the left bar button default value is the title of the view that loaded the current one, in other words the view to be shown when the button is pressed (back button). I want to change the text shown on the button to something else. I tried…
Dale
  • 3,527
  • 6
  • 24
  • 22
222
votes
18 answers

Changing navigation title programmatically

I have a navigation bar with a title. When I double click the text to rename it, it actually says it's a navigation item, so it might be that. I'm trying to change the text using code, like: declare navigation bar as navagationbar here button stuff…
Rising
  • 2,465
  • 3
  • 13
  • 8
216
votes
18 answers

How to change Navigation Bar color in iOS 7?

How do I change the Navigation Bar color in iOS 7? Basically I want to achieve something like the Twitter Nav Bar (updated Twitter for iOS7 that is). I embedded-in a nav bar atop a view controller. All I want is to change the nav bar color to light…
Patricio Guerra
  • 2,277
  • 2
  • 13
  • 11
210
votes
17 answers

Add a UIView above all, even the navigation bar

I want to display, above any other views, even the navigation bar, a kind of "pop-up" view that looks like this: full screen black background with a 0.5 alpha to see the other UIViewController underneath. a UIView window in the middle with some…
Nicolas Roy
  • 3,773
  • 5
  • 27
  • 42
199
votes
39 answers

Removing the title text of an iOS UIBarButtonItem

What I wanted to do is to remove the text from the 'Back' button of a UIBarButtonItem, leaving only the blue chevron on the navigation bar. Keep in mind that I'm developing for iOS 7. I've tried several methods, including, but not limited to: This…
Pan Ziyue
  • 2,287
  • 2
  • 16
  • 17
192
votes
18 answers

NavigationBar bar, tint, and title text color in iOS 8

The background text in the status bar is still black. How do I change the color to white? // io8, swift, Xcode 6.0.1 override func viewDidLoad() { super.viewDidLoad() self.navigationController?.navigationBar.barTintColor =…
AG1
  • 6,648
  • 8
  • 40
  • 57
1
2 3
99 100