iOS Learning Note (i)--scollview

Source: Internet
Author: User

UIView have a method: SetCenter, SetBounds

SetCenter is the center point of the set control

SetBounds is the size of the set control

Control is added to a view, then the attached view moves.

Uiscrollview scrolling View

1.png formatted files do not need a home suffix to use: UIImage *image = [UIImage imagenamed:@ "keke01"]; < Johuanto file name is [email protected] The above method matches the image of half the size of the original picture

2. Do not scroll when the ScrollView content size is not set. [ScrollView setContentSize:image.size]; < to scroll after

3.scorllView Allow paging: [ScrollView Setpagingenable:yes]; < scrolling view has pagination effect when the picture is scrolled

4. Scrolling View Agent method Scrolling completion means that the page switch is complete:-(void) scrollviewdidenddecelerating: (Uiscrollview *) ScrollView {}; < protocol method, you need to add the protocol in. h and set yourself as the rationale.

Uipagecontrol Paging control controls

Common Properties:

Nsinteger numberofpages: Total pages

Nsinteger currentpage: The current page number

BOOL Hidesforsinglepage: Whether to hide the view when there is only one page

Uicolor *currentpageindicatortintcolor: The color of the currently selected page

Uicolor *pageindicatortintcolor: Colors on other pages

How to listen for paging controls: [Pagecontrol addtarget:self Action: (SEL) forcontrolevents:uicontroleventvaluechanged]; <;

Pagination Control page Change then departure action! The action parameter should be in the Uipagecontrol format.

iOS Learning Note (i)--scollview

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.