IOS Study Notes-UINavgationController,

Source: Internet
Author: User

IOS Study Notes-UINavgationController,
Creating Navigation Controllers

-(Instancetype) initWithRootViewController :( UIViewController *)rootViewController

Parameter: UIViewController

 

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

-(Instancetype) initWithNavigationBarClass :( Class)navigationBarClass
ToolbarClass :( Class)toolbarClass

Parameters: navigationBarClass and toolbarClass

 

Attribute: topViewController

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

 

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

 

Attribute:VisibleViewController

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

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

 

Property: viewControllers

The view controllers currently on the navigation stack.

@ Property (nonatomic, copy) NSArray * viewControllers

 

Method: 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

Method: PushViewController: animated:

Pushes a view controller onto the explorer's stack and updates the display.

-(Void) pushViewController :( UIViewController *)viewController
Animated :( BOOL)animated

Parameters: ViewController, animated

 

Method: PopViewControllerAnimated:

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

-(UIViewController *) popViewControllerAnimated :( BOOL)animated

Parameters: Animated

 

Method: PopToRootViewControllerAnimated:

Pops all the view controllers on the stack doesn't the root view controller and updates the display.

-(NSArray *) popToRootViewControllerAnimated :( BOOL)animated

Parameters: Animated

 

Method: 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

Parameters: viewController and animated

 

Attribute: Interactivepopgsturerecognizer

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

@ Property (nonatomic, readonly) UIGestureRecognizer * interactivepopgsturerecognizer

 

 

Grouping Navigation Bars

Attribute:navigationBar

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

@ Property (nonatomic, readonly) UINavigationBar * navigationBar

 

 

Method:-setNavigationBarHidden: animated:

Sets whether the navigation bar is den.

-(Void) setNavigationBarHidden :( BOOL)hidden
Animated :( BOOL)animated

 

Hiding the Navigation Bar

Attribute: hidesBarsOnTop

Attribute: hidesBarsOnSwipe

Attribute: hidesBarsWhenVerticallyCompact

Attribute: hidesBarsWhenKeboardAppears

Property: navigationBarHidden

Attribute: barhideontapgesturerecognier

Attribute: barHideOnSwipeGestureRecognizer

 

 

Postscript:

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.