Learn iOS Development UI Chapter--uiscrollview/delegate/pagecontrol/uitimer

Source: Internet
Author: User

Properties of 1.UIscrollView ==================================================1.1 Common Properties @property (nonatomic) cgpoint Contentoffset: This property is used to indicate the position of the Uiscrollview scroll @property (nonatomic) cgsize contentsize; This property is used to represent the dimensions of the Uiscrollview content. Scrolling range (How far can you roll) @property (nonatomic) uiedgeinsets Contentinset; This property can be added to the additional scrolling area 1.2 for 4 weeks Uiscrollview other properties @property ( nonatomic) bool bounces; set Uiscrollview whether a spring effect is required @property (nonatomic,getter=isscrollenabled) bool scrollenabled; Sets whether Uiscrollview can scroll @property (nonatomic) bool Showshorizontalscrollindicator, whether the horizontal scroll bar @property (nonatomic) bool is displayed Showsverticalscrollindicator, whether to display the zoom and paging ==================================================1 of the vertical scroll bar 2.UIScrollView. Agent Mode 1.1 Two ideas of agent thought

1). Listening thoughts:B listen to a what's going on

2). Notice the idea:a something happened, to inform B to do

Proxy usage for 1.2scrollView

1). How to become an agent (three steps)

* Declaration Agreement

* Set proxy object self. Scrollview.delegate = self;

* Implement protocol method

2). agent monitoring ScrollView drag and Drop events

3). Scaling with proxies

* become an agent of Uiscrollview ()

* Set Scaling objects (by Viewforzoominginscrollview method)

* Set Zoom to Range (Maximumzoomscale,minimumzoomscale)

2. Paging

1. As long as the Pageenabled property of the Uiscrollview is set to Yes,uiscrollview will be divided into separate pages, the contents of the content can be paginated 2. Generally with Uipagecontrol enhance the paging effect, Uipagecontrol Common properties are as follows a total of how many pages @property (nonatomic) Nsinteger numberofpages;

The page number that is currently displayed

@property (nonatomic) Nsinteger currentpage;

Whether you need to hide the page number indicator when there is only one page

@property (nonatomic) BOOL hidesforsinglepage;

Other page number indicator Color property (nonatomic,retain) Uicolor *pageindicatortintcolor;

The color of the current page indicator @property (nonatomic,retain) uicolor *currentpageindicatortintcolor;3. Timer ============================== ====================

+ (nstimer *) Timerwithtimeinterval: (nstimeinterval) ti target: (ID) atarget selector: ( SEL) aselector userInfo: (ID) UserInfo repeats: (BOOL);

-(void) invalidate;

The timer can be stopped by the Invalidate method, and once the timer is stopped, the task cannot be performed again. You can only create a new timer to perform a new task.

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.