Skip to content
Search

IOS:UINavigationController

lastmod 2018-08-17created 2014-02-078 edits

The UINavigationController class implements a specialized view controller that manages the navigation of hierarchical content. This navigation interface makes it possible to present your data efficiently and makes it easier for the user to navigate that content. You generally use this class as-is but in iOS 6 and later you may subclass to customize the class behavior.

The basic settings of the navigation bar (title, left/right buttons) are configured as follows.

UIBarButtonItem* rightButton;
// rightButton setting...
self.navigationItem.rightBarButtonItem = rightButton;

UIBarButtonItem* leftButton;
// leftButton setting...
self.navigationItem.leftBarButtonItem = leftButton;

UIView * customTitleView;
// Custom Title View setting...
self.title = title;
self.navigationItem.titleView = customTitleView;

Create the UIBarButtonItem and UIView yourself, then add them.

Troubleshooting

Solutions to related problems.

iOS6 to iOS7 Translucent

When upgrading from iOS6 to iOS7, the NavigationBar Layout may not display correctly (it overlays the top of the View below). In this case, changing the translucency property may fix it.

UINavigationController * navigatorController;
// ...
navigatorController.navigationBar.translucent = NO;

Favorite site

References


  1. UINavigationController_Customization_(title,_background_color,_image,_add_button).pdf ↩