UI Grooming-----Part4--uiscrollview

Source: Internet
Author: User

(1) Uiscrollview can be used to display more than one screen of content, beyond the screen range of content can be viewed by swiping.

(2) Common properties:

@property (nonatomic) Cgpoint contentoffset; Uiscrollview Current Scroll position

@property (nonatomic) cgsize contentsize; Set Content size Size

@property (nonatomic) uiedgeinsets contentinset; can increase scrolling range in four weeks

@property (nonatomic,getter=isscrollenabled) BOOL scrollenabled; Whether you can scroll

@property (nonatomic) BOOL bounces; Does it have a spring effect?

@property (nonatomic) BOOL showshorizontalscrollindicator; Whether to show horizontal scroll bars

@property (nonatomic) BOOL showsverticalscrollindicator; Whether to show vertical scroll bars

@property (nonatomic) Uiscrollviewindicatorstyle Indicatorstyle; Set scroll bar style

@property (nonatomic,readonly,getter=isdragging) BOOL dragging; Are you being dragged

@property (nonatomic,readonly,getter=istracking) BOOL tracking; Touch has not been dragged to Yes, otherwise no

@property (nonatomic,readonly,getter=isdecelerating) BOOL decelerating; Are you slowing down?

@property (nonatomic,readonly,getter=iszooming) BOOL zooming; Whether you are scaling

@property (nonatomic,getter=ispagingenabled) BOOL pagingenabled; Can I set the paging effect

(3) Gesture scaling: First set object as agent for <UIScrollViewDelegate>

@property (nonatomic) cgfloat Minimumzoomscale; Minimum scale to shrink

@property (nonatomic) cgfloat Maximumzoomscale; Maximum scale of magnification

(4) In the method of invocation, the more important method is

-(void) scrollviewwillenddragging: (Uiscrollview *) scrollviewwithvelocity: (Cgpoint) Velocitytargetcontentoffset: ( Inoutcgpoint *) Targetcontentoffset

{

NSLog (@ "%f", Targetcontentoffset->x)//can print offset in x direction

}

(5) Pinch gesture zooms out and returns to view

-(uiview*) Viewforzoominginscrollview: (Uiscrollview *) ScrollView

{

UIView *imageview = [scrollviewviewwithtag:1000]; Set the tag value of the picture as the pass parameter condition

Returnimageview;

}

UI Grooming-----Part4--uiscrollview

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.