Knowledge summary of the IOS navigation controller

Source: Internet
Author: User

Knowledge summary of the IOS navigation controller

After adding the navigation controller:

1. Each page will have a top navigation bar Navigationbar and the bottom toolbar toolbar, which are the properties of the navigation controller NAVC. and the navigation bar is not hidden by default, while the bottom toolbar is hidden by default.

2. You can display the bottom toolbar by setting the self. Navigationcontroller. Toolbarhidden = No, and the contents of the toolbarcan be set by Viewcontroller's ToolbarItems. The order of the display is consistent with the order in which the settings are placed in the Nsarray, where each data is a Uibarbuttonitem object.

3. Navigation controls navigation bar Navigationbar and toolbar toolbar navigation buttons Navigationitem and ToolbarItems are the properties of the current Page view controller VC. Special note: The left Back button name of the next page is set by the Backbarbuttonitem of the current page. You can only set the name and cannot set the shape. If the next VC set Leftbarbuttonitem, then this page settings Backbarbuttonitem invalid, will be overwritten by the left button of the next page.

4. The name of the left back button on the next page is set by the previous controller Backbarbuttonitem. If the previous page does not have the name of the Backbarbuttonitem button set, the default display is back. However, if the previous page has the Navigationitem.title property set, the title is displayed. If Navigationitem.titleview is set on the previous page, the default back is still displayed on the left side of the next page.

5. The navigation controller will have a Viewcontrollers property, where the VC is organized as a stack, when pushviewcontroller or Addchildviewcontroller or directly added to the array navC2. Viewcontrollers = @[vc1,vc2,vc3]; Because a new page appears, you need to create an object that corresponds to the VC before Push,add. When using Poptoviewcontroller, the VC at the top of the stack will be destroyed (if you do not want to be destroyed, you need to give it a strong reference), the page returned does not need to create a new pop to the VC object, because the previous use of push, it was pressed into the bottom of the stack, and will not be destroyed.

6. Reprint a Good Article "Uinavigationcontroller use detailed ", we learn together.

Knowledge summary of the IOS navigation controller

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.