IOS學習筆記-UINavgationController,

來源:互聯網
上載者:User

IOS學習筆記-UINavgationController,
Creating Navigation Controllers

- (instancetype)initWithRootViewController:(UIViewController *)rootViewController

參數:UIViewController

 

方法:initWithNavigationBarClass:toolbarClass
Initializes and returns a newly created navigation controller that uses your custom bar subclasses.

- (instancetype)initWithNavigationBarClass:(Class)navigationBarClass
                              toolbarClass:(Class)toolbarClass

參數:navigationBarClass、toolbarClass

 

屬性:topViewController

The view controller at the top of the navigation stack. (read-only)

 

@property(nonatomic, readonly, retain) UIViewController *topViewController

 

屬性visibleViewController

The view controller associated with the currently visible view in the navigation interface. (read-only)

@property(nonatomic, readonly, retain) UIViewController *visibleViewController

 

屬性:viewControllers

 The view controllers currently on the navigation stack.

@property(nonatomic, copy) NSArray *viewControllers

 

方法:setViewControllers:animated:

Replaces the view controllers currently managed by the navigation controller with the specified items.

- (void)setViewControllers:(NSArray *)viewControllers
                  animated:(BOOL)animated

 

 

Pushing and Popping Stack Items

方法:pushViewController:animated:

Pushes a view controller onto the receiver’s stack and updates the display.

- (void)pushViewController:(UIViewController *)viewController
                  animated:(BOOL)animated

參數:viewController、animated

 

方法:popViewControllerAnimated:

Pops the top view controller from the navigation stack and updates the display.

- (UIViewController *)popViewControllerAnimated:(BOOL)animated

參數:animated

 

方法:popToRootViewControllerAnimated:

Pops all the view controllers on the stack except the root view controller and updates the display.

- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated

參數:animated

 

方法:popToViewController:animated:

Pops view controllers until the specified view controller is at the top of the navigation stack.

- (NSArray *)popToViewController:(UIViewController *)viewController
                        animated:(BOOL)animated

參數:viewController、animated

 

屬性:interactivePopGestureRecognizer 

The gesture recognizer responsible for popping the top view controller off the navigation stack. (read-only)

@property(nonatomic, readonly) UIGestureRecognizer *interactivePopGestureRecognizer

 

 

Configuring Navigation Bars

屬性:navigationBar

 The navigation bar managed by the navigation controller. (read-only)

@property(nonatomic, readonly) UINavigationBar *navigationBar

 

 

方法:-setNavigationBarHidden:animated:

Sets whether the navigation bar is hidden.

- (void)setNavigationBarHidden:(BOOL)hidden
                      animated:(BOOL)animated

 

Hiding the Navigation Bar

屬性:hidesBarsOnTop

屬性: hidesBarsOnSwipe

屬性:hidesBarsWhenVerticallyCompact

屬性:hidesBarsWhenKeboardAppears

屬性:navigationBarHidden

屬性:barHideOnTapGestureRecognzier

屬性:barHideOnSwipeGestureRecognizer

 

 

附言:

Use this initialization method if you want to use custom navigation bar or toolbar subclasses with the navigation controller. If you use this method, you are responsible for adding a root view controller before presenting the navigation controller onscreen.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.