Paging controls in iOS (Uipagecontrol)

Source: Internet
Author: User

#import"RootViewController.h"@interface Rootviewcontroller () @end @implementation Rootviewcontroller- (void) viewdidload {[Super viewdidload]; /** * Uipagecontrol pagination control, provides the following features: 1. Show the current total number of pages 2. The current page of the display is 3. Toggle the current display of the Pagecontrol to display a different interface*/    //1. Creating a controlUipagecontrol *pagecontrol = [[Uipagecontrol alloc] Initwithframe:cgrectmake ( -, -,260, -)]; //2. Configuration Properties//Pagecontrol.backgroundcolor = [Uicolor Redcolor]; //3. Set the total number of pages displayedPagecontrol.numberofpages =Ten; //4. Set the point colorPagecontrol.pageindicatortintcolor =[Uicolor Redcolor]; //sets the current point color current meaningPagecontrol.currentpageindicatortintcolor =[Uicolor Bluecolor]; //Set the default current pointPagecontrol.currentpage =5; //Add Response Events[Pagecontrol addtarget:self Action: @selector (Handlepagecontrol:) forcontrolevents:uicontroleventvaluechanged                            ]; //3. Add to Parent View[Self.view Addsubview:pagecontrol]; //4. Release[Pagecontrol release];}- (void) didreceivememorywarning {[Super didreceivememorywarning]; //Dispose of any resources the can be recreated.}#pragmaPoint-(void) Handlepagecontrol: (Uipagecontrol *) pagecontrol{NSLog (@"%ld", pagecontrol.currentpage);}

Paging controls in iOS (Uipagecontrol)

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.