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
2
votes
0 answers

Styling the navigation bar in UIDocumentPickerViewController

In my app, the primary theme has blue navigation bars with white bar button items and titles. I set the values for colors like this in the App Delegate. UINavigationBar.appearance().isTranslucent = false UINavigationBar.appearance().tintColor =…
Isuru
  • 30,617
  • 60
  • 187
  • 303
2
votes
1 answer

Set custom UINavigationBar class from Interface Builder

I would like to have a custom UINavigationController subclass that has a custom UINavigationBar class as its nav bar, but it needs to be something that can be set from a storyboard. I don't see any other way to set the navigationBarClass on a…
rmooney
  • 6,123
  • 3
  • 29
  • 29
2
votes
1 answer

Swift iOS -Navigation Bar won't stay Hidden even though I'm hiding it

Everything is happening programmatically. No Storyboard and The collection view's vc and the detailed vc are both inside a TabBarController. I'm using a collection view and when I tap a cell in didSelectItem I push on a detailed view controller. In…
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
2
votes
1 answer

Landscape view issue with navigation bar

Default Navigation bar height is 64.But after change it's orientation to landscape navigation bar height changed to 28.I want to set Fix navigation bar size in all orientation.
Vinayak Bhor
  • 691
  • 1
  • 8
  • 20
2
votes
1 answer

Search bar not aligned next to back button in navigation bar

I used a custom navigation controller class to remove the back button in my navigation bar, with the following: class CustomNavigationController: UINavigationController, UINavigationControllerDelegate { override func viewDidLoad() { …
2
votes
0 answers

How to change navigation bar color in outside of safe area

This view is Present from mainviewcontroller then i set large title on this view then then i change color of navigation bar but color is not change in outside of safe area in navigation bar. so, how can i change color in whole navigation bar in…
ikbal
  • 1,114
  • 1
  • 11
  • 30
2
votes
2 answers

How to change UINavigationBar background color from clear to red when user scrolls down in the table view

I have a table view and a navigation bar in front of it. I want that when user scrolls down the background color of the navigation bar starts to change from clear to red, like increasing alpha. Problem for me is that when user scroll down when…
Saeed Rahmatolahi
  • 1,317
  • 2
  • 27
  • 60
2
votes
3 answers

Oritentation issue in landscape (iphone)

Good day! I have a view which i forcefully landscape. but the problem which i am facing is that the navigation bar buttons are somewhere else but i have to click few steps (inches) back to let it act. e.g. if button is at frame 0,0 then i have to…
IDev
  • 1,221
  • 1
  • 11
  • 25
2
votes
3 answers

UINavigationBar color animation synchronized with push animation

I want to achieve smooth animation between views with a different UINavigationBar background colors. Embedded views have the same background color as UINavigationBar and I want to mimic push/pop transition animation like: I've prepared custom…
Tomasz Pe
  • 696
  • 7
  • 19
2
votes
0 answers

iOS 11: Presenting modal view with UINavigationBar and SerchBar—SearchBar is being cropped

I'd like to present modally a View Controller embedded in a UINavigationBar with a search and the hidesNavigationBarDuringPresentation = true option. When presenting on iPad, the search bar is being cropped. searchController.searchBar.sizeToFit()…
2
votes
3 answers

ios11: UISearchBar in Navigation Bar

I implemented a gradient in my navigation bar with the help of this answer. However, the gradient excludes the search bar. But this is what I would like: Any idea what seems to be the problem? Big thank you for any help someone can offer. I'll…
degenPenguin
  • 725
  • 1
  • 8
  • 23
2
votes
1 answer

Cant change navigation bar height ios 11

I cant change navigation bar frame in ios 11. Here is sample of my code for ios 10: if let navigationBar = self.navigationController?.navigationBar { let frame = CGRect(x: navigationBar.frame.origin.x, y:…
jMelvins
  • 194
  • 1
  • 10
2
votes
1 answer

Flutter: Focus keyboard on back navigation

I want to focus a textField after the user navigated back with the back button in the navigation bar. How do you do that? I tried the autofocus property of the TextField widget. But this only works when navigating forward when the widget gets…
Renato Stauffer
  • 738
  • 2
  • 14
  • 30
2
votes
1 answer

Gradient in navigation bar differing from view below it .

The targeted design i want to reach is the below image : I used the code below to create the gradient and set it to the navigation bar with the help of the function image from layer. func image(fromLayer layer: CALayer) -> UIImage { …
MhmdRizk
  • 1,591
  • 2
  • 18
  • 34
2
votes
1 answer

Segue Not Showing Navigation Bar

I have 2 ViewControllers that are presenting a new ViewController. The first is in a navigation controller so it works as expected with a segue push. The second however is from a ViewController without a navigation bar. I'm programmatically…
pjmanning
  • 1,241
  • 1
  • 20
  • 48