UINavigationController(导航栏控制器)
@interface UINavigationController : UIViewController
//navigationBar是UINavigationController的一个属性
@property(nonatomic,readonly) UINavigationBar *navigationBar;
//是否隐藏
@property(nonatomic,getter=isNavigationBarHidden) BOOL navigationBarHidden;
//进入下一个视图
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated;
//返回上一个视图
- (nullable UIViewController *)popViewControllerAnimated:(BOOL)animated;
//返回某个视图
- (nullable NSArray<__kindof UIViewController *> *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated;
//返回根视图
- (nullable NSArray<__kindof UIViewController *> *)popToRootViewControllerAnimated:(BOOL)animated;
UINavigationBar(导航栏)
@interface UINavigationBar : UIView
//状态栏底色
@property(nullable, nonatomic,copy)UIColor *backgroundColor;
//状态栏风格
@property(nonatomic,assign) UIBarStyle barStyle;
/*************************************
UIBarStyleDefault = 0, 默认
UIBarStyleBlack = 1, 黑色
**************************************/
是否半透明
@property(nonatomic,assign,getter=isTranslucent) BOOL translucent
//标题颜色
@property(null_resettable, nonatomic,strong) UIColor *tintColor;
//状态栏颜色
@property(nullable, nonatomic,strong) UIColor *barTintColor
UINavigationItem(导航项)
@interface UIViewController (UINavigationControllerItem)
//navigationItem是UIViewController的一个属性
@property(nonatomic,readonly,strong) UINavigationItem *navigationItem;
//(1)设置导航栏标题
@property (nullable, nonatomic, copy) NSString *title;
@interface UINavigationItem : NSObject
//设置标题
//(2)直接设置字符串标题
@property(nullable, nonatomic,copy) NSString *title;
//(3)设置view类标题
@property(nullable, nonatomic,strong) UIView *titleView;
//设置提示
@property(nullable,nonatomic,copy) NSString *prompt;
//设置下页返回按钮
@property(nullable,nonatomic,strong) UIBarButtonItem *backBarButtonItem;
//设置左导航按钮
@property(nullable, nonatomic,strong) UIBarButtonItem *leftBarButtonItem;
@property(nullable,nonatomic,copy) NSArray<UIBarButtonItem *> *leftBarButtonItems;
//设置又导航按钮
@property(nullable, nonatomic,strong) UIBarButtonItem *rightBarButtonItem;
@property(nullable,nonatomic,copy) NSArray<UIBarButtonItem *> *rightBarButtonItems;
//动画隐藏导航栏
@interface UINavigationController : UIViewController
- (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated;