Skip to content

IOS:UINavigationController

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.

내비게이션바의 기본설정(타이틀, 좌/우 버튼)방법은 아래와 같다.

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;

UIBarButtonItem, UIView를 직접 생성한 후 추가하면 된다.

Troubleshooting

관련된 문제 해결 방법을 제시한다.

iOS6 to iOS7 Translucent

iOS6에서 iOS7으로 버전업 되는 과정에서 NavigationBar Layout이 정상적으로 출력되지 않는 현상(하단 View의 상단으로 Overlay)이 발생될 수 있다. 이 때, 반투명 속성을 변경하면 해결될 수 있다.

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

Favorite site

References


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