Page controllers (Uipageviewcontroller) and Uiscrollerview

Source: Internet
Author: User
UIPageControl继承了UIControl基类,默认属于活动控件,它可以与用户进行交互,经常与UIScrollerView结合使用,在实际项目也是经常使用的。当把UIScrollView的pagingEnabled设置为YES之后,UIScrollView至少每次滚动一页。此时通常结合UIPageControl使用,UIPageControl控件会充当两个功能。

Use Uipagecontrol to show that the current Uiscrollview is showing the page.
Program Uiscrollview automatically scrolls to the appropriate page when the user taps the Uipagecontrol control.
Initialize the images that will be displayed:
Coverlist=[nsarray arraywithobjects:@ "11.png", @ "22.png", @ "33.png", nil];
Get the number of pictures for later use:
Nsuinteger Numberpages=coverlist.count;
To prevent excessive CPU pressure, this takes the form of lazy loading to create the Wxpagecontroller controller, just add some null as placeholders to the array and wait until the Pagecontroller is actually created
Viewcontrollers=[[nsmutablearray Alloc]init];
for (Nsuinteger i=0; i

Page controllers (Uipageviewcontroller) and Uiscrollerview

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.