iOS notes 2

Source: Internet
Author: User

Basic use of Uiscrollview:

Uiscrollview 's usage is simple.

Add what you need to show to Uiscrollview

Set the Contentsize property of the Uiscrollview to tell uiscrollview all the dimensions of the content, that is, to tell it the range of scrolling (how far to roll, where to roll to the end)

Common Properties of Uiscrollview:

@property(nonatomic) cgpoint contentoffset;

This property is used to indicate where the Uiscrollview scrolls.

@property(nonatomic) cgsize contentsize;

This property is used to indicate the size of the Uiscrollview content, the scrolling range (how far to roll)

@property (nonatomic) uiedgeinsets contentinset;

This property is capable of Adding additional scrolling areas for 4 weeks of Uiscrollview

@property(nonatomic) BOOL bounces;

Set Uiscrollview If spring effect is required

@property(nonatomic,getter=isscrollenabled) BOOL scrollenabled;

Sets whether Uiscrollview can scroll

@property(nonatomic) BOOL showshorizontalscrollindicator;

Whether to display the horizontal scroll bar

@property(nonatomic) BOOL showsverticalscrollindicator;

Whether to show vertical scroll bars

To implement UIScroll scaling through proxies:

Set id<uiscrollviewdelegate> delegate proxy object for Uiscrollview

Set minimumzoomscale : Minimum scale to zoom out

Set Maximumzoomscale : Maximum scale magnification

Let the proxy object implement the following method to return the view control that needs to be scaled

-(UIView *) Viewforzoominginscrollview: (uiscrollview *) ScrollView;

Other proxy methods related to scaling

Call when Zoom is complete

-(void) scrollviewwillbeginzooming: (uiscrollview *) ScrollView Withview: (UIView *) view

is being scaled when calling the

-(void) Scrollviewdidzoom: (uiscrollview *) scrollView

iOS notes 2

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.