Getting Started with iOS development: Tile Navigation-page based navigation and case implementation

Source: Internet
Author: User

Based on paging navigation implementation

After iOS 5, you can use the paging controller (Uipageviewcontroller) to build applications that are similar to e-book effects, which we call pagination based applications. There are a number of related view controllers for a paging application

The paging controller (Pageviewcontroller) needs to be placed in a parent view controller with a child view controller under the paging controller, with each child view controller corresponding to a page in the diagram.

Classes and protocols needed in applications based on paging navigation: Uipageviewcontrollerdatasource protocols and Uipageviewcontrollerdelegate protocols and Uipageviewcontroller classes, Uipageviewcontroller does not have a corresponding view class.

The most important method in the Uipageviewcontrollerdelegate entrustment agreement is pageviewcontroller:spinelocationforinterfaceorientation:, It sets the spine position (Spine Location) and initializes the home page according to the direction of the screen rotation.

There are two commonly used properties in Uipageviewcontroller: Two-sided display (doublesided) and spine position (spinelocation).

1. Two-sided display, is when the page is turned up, even pages will be displayed on the back. The figure is set to Yes doublesided, figure 6-14 doublesided set to No (single-sided display), one-sided display in the page turned up, can see the back of the page, the back content is the current page through the past, and the current content is the opposite mirror.

2. Spine position. The spine position is also an important attribute, but its Spinelocation property is read-only and, to set it, it needs to be passed through the Pageviewcontroller in the Uipageviewcontrollerdelegate Delegate protocol: Spinelocationforinterfaceorientation: Method. The spine position is defined by the enumeration uipageviewcontrollerspinelocation, and the member variables under that enumeration type are shown below.

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.