美文网首页
UINavigationController 层级

UINavigationController 层级

作者: 穷小子 | 来源:发表于2016-01-18 14:54 被阅读279次
    UINavigationController_1.png UINavigationController_2.png

    UINavigationController

    常用方法

    - (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; 
    
    

    常用属性

    @property(nullable, nonatomic,readonly,strong) UIViewController *topViewController; 
    
    @property(nullable, nonatomic,readonly,strong) UIViewController *visibleViewController;
    
    @property(nonatomic,copy) NSArray<__kindof UIViewController *> *viewControllers; 
    
    @property(nonatomic,readonly) UINavigationBar *navigationBar; 
    
    @property(nonatomic,getter=isToolbarHidden) BOOL toolbarHidden NS_AVAILABLE_IOS(3_0) __TVOS_PROHIBITED; 
    
    

    UINavigationBar

    常用属性

    @property(nullable, nonatomic,strong) UIColor *barTintColor NS_AVAILABLE_IOS(7_0) UI_APPEARANCE_SELECTOR; 
    
    //    NSString *const UITextAttributeFont;                       value: UIFont
    //    NSString *const UITextAttributeTextColor;                  value: UIColor
    //    NSString *const UITextAttributeTextShadowColor;            value: UIColor
    //    NSString *const UITextAttributeTextShadowOffset;           value: NSValue wrapping a UIOffset struct.
    @property(nullable,nonatomic,copy) NSDictionary<NSString *,id> *titleTextAttributes NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;
    

    UIViewController (UINavigationControllerItem)

    常用属性

    @property(nonatomic,readonly,strong) UINavigationItem *navigationItem; 
    
    @property(nonatomic) BOOL hidesBottomBarWhenPushed __TVOS_PROHIBITED;
    
    @property(nullable, nonatomic,readonly,strong) UINavigationController *navigationController; 
    

    简介

    navigationItemUIViewController的一个属性,这个属性是为UINavigationController服务的。

    “The navigation item used to represent the view controller in a parent’s navigation bar. (read-only)”,

    navigationItemnavigation Bar代表一个viewController.

    UINavigationItem

    常用属性

    @property(nullable, nonatomic,copy)   NSString        *title;            
    
    @property(nullable, nonatomic,strong) UIView          *titleView;         
    
    @property(nullable,nonatomic,copy)   NSString *prompt __TVOS_PROHIBITED;     
    
    @property(nullable,nonatomic,strong) UIBarButtonItem *backBarButtonItem __TVOS_PROHIBITED; 
    
    @property(nonatomic,assign) BOOL hidesBackButton __TVOS_PROHIBITED; 
    
    @property(nullable,nonatomic,copy) NSArray<UIBarButtonItem *> *leftBarButtonItems NS_AVAILABLE_IOS(5_0);
    
    @property(nullable,nonatomic,copy) NSArray<UIBarButtonItem *> *rightBarButtonItems NS_AVAILABLE_IOS(5_0);
    

    相关文章

      网友评论

          本文标题:UINavigationController 层级

          本文链接:https://www.haomeiwen.com/subject/fmekkttx.html