1.创建UINavigationController
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:one];
2.常用属性和方法
//不带动画隐藏
@property(nonatomic,getter=isNavigationBarHidden) BOOL navigationBarHidden
//带动画隐藏
- (void)setNavigationBarHidden:(BOOL)hidden animated: (BOOL)animated
//获取当行控制器中的视图数组
@property(nonatomic,copy) NSArray *viewControllers
//将试图控制器亚茹导航控制器的栈容器中
- (void)pushViewController:(UIViewController *)viewController
animated:(BOOL)animated
//将试图控制器从导航控制器中弹出
- (UIViewController *)popViewControllerAnimated:(BOOL)animated
//切换至制定的视图控制器
- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated
//回到根视图控制器
- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated
3.UINavigationBar
//创建UIBarButtonItem
1.文字UIBarButtonItem的创建方式
- (instancetype)initWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action
2.图片UIBarButtonItem的创建方式
- (instancetype)initWithImage:(UIImage *)image style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action
3.创建系统自带的UIBarButtonSystemItem
- (instancetype)initWithBarButtonSystemItem: (UIBarButtonSystemItem)systemItem target:(id)target action: (SEL)action
"UIBarButtonItem常用属性"
//设置样式
@property(nonatomic,assign) UIBarStyle barStyle
//是否透明
@property(nonatomic,assign,getter=isTranslucent) BOOL translucent
//设置颜色
@property(nonatomic,retain) UIColor *barTintColor
//设置背景图片
-(void)setBackgroundImage:(UIImage *)backgroundImage
forBarMetrics:(UIBarMetrics)barMetrics