IOS Uinavigationcontroller Navigation Controller

Source: Internet
Author: User

/**

Navigation Controller Master :

1. Create a navigation controller

Uinavigationcontroller *nav = [[Uinavigationcontroller alloc] initWithRootViewController:self.viewController];

2.zhan ( all sub-controllers in Zhan)

Self.navigationController.viewControllers;

3. press the controller into the Zhan

[Self.navigationcontroller Pushviewcontroller:second Animated:yes];

4. Eject the controller from the Zhan

1> the Zhan top controller.

5. What the navigation bar displays

bounce back to Zhan top

[Self.navigationcontroller Popviewcontrolleranimated:yes];

Back to Bottom controller (Root controller )

bounce back to the bottom of Zhan

[Self.navigationcontroller Poptorootviewcontrolleranimated:yes];

Back to which man controller

[Self.navigationcontroller PopToViewController:animated:YES];

5. What the navigation bar displays

Zhan Navigationitem Properties of the top controller

Self.navigationItem.title = @ " Hello World";

Self.navigationItem.leftBarButtonItem =[[uibarbuttonitem Alloc]initwithbarbuttonsystemitem: Uibarbuttonsystemitemcamera Target:nil Action:nil];

Set the Back button for the next interface

Self.navigationItem.backBarButtonItem =[[uibarbuttonitem alloc] initwithtitle:@ " back" style: Uibarbuttonitemstyleplain Target:nil Action:nil];

The Navigationitem property of the/zhan top controller determines what is displayed in the navigation bar @

The return key to the left of the navigation bar is determined by the previous key

Self.navigationItem.rightBarButtonItem = [[Uibarbuttonitem alloc]initwithbarbuttonsystemitem: Uibarbuttonsystemitemcompose Target:nil Action:nil];

Self.navigationItem.rightBarButtonItem = [[Uibarbuttonitem alloc]initwithtitle:@ ' settings ' style: Uibarbuttonitemstyledone target:self Action: @selector (clicksetting)];

Do any additional setup after loading the view from its nib.

6.//zhan Top Controller

Self.navigationController.topViewController;

*/

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.