Waterfall Flow Implementation Principle

Source: Internet
Author: User

Waterfall Flow Implementation Principle

Add multiple views in the view, and when you scrub one of the views, invoke the Protocol method so that the other scrollview also follow the scrub.

The core code of the waterfall stream: When a table view is offset, setting another table view also offsets the same coordinates

This method is called when scrolling the content (any content offsets are called)

-(void) Scrollviewdidscroll: (Uiscrollview *) ScrollView

{

if (scrollview==_tableview1) {

Cgpoint Pt=_tableview1.contentoffset;

[_tableview2 setcontentoffset:pt];

}

else{

Cgpoint Pt=_tableview2.contentoffset;

[_tableview1 setcontentoffset:pt];

}

}

Proxy methods for other ScrollView <UIScrollViewDelegate>

When any offsets occur

-(void) Scrollviewdidscroll: (Uiscrollview *) ScrollView;

Any scale scale

-(void) Scrollviewdidzoom: (Uiscrollview *) ScrollView Ns_available_ios (3_2);

Called when the drag is started (may also be called after a period or distance has been moved)

-(void) scrollviewwillbegindragging: (Uiscrollview *) ScrollView;

The finger is going to lift up and stop dragging when called

-(void) scrollviewwillenddragging: (Uiscrollview *) ScrollView withvelocity: (cgpoint) Velocity targetcontentoffset: ( InOut cgpoint *) Targetcontentoffset Ns_available_ios (5_0);

Called when the finger lifts and stops dragging, the view also moves a distance after lifting, slowly slowing down to stop

-(void) scrollviewdidenddragging: (Uiscrollview *) ScrollView willdecelerate: (BOOL) decelerate;

Called when the finger will start dragging

-(void) scrollviewwillbegindecelerating: (Uiscrollview *) ScrollView;

Called when a drag is stopped

-(void) scrollviewdidenddecelerating: (Uiscrollview *) ScrollView;

Called when the animation is ended

-(void) Scrollviewdidendscrollinganimation: (Uiscrollview *) ScrollView;

Returns a zoomed-in view

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

Called when the view is going to start zooming

-(void) scrollviewwillbeginzooming: (Uiscrollview *) ScrollView Withview: (UIView *) View Ns_available_ios (3_2);

Called when the zoom ends

-(void) scrollviewdidendzooming: (Uiscrollview *) ScrollView Withview: (UIView *) View Atscale: (cgfloat) scale;

Whether to roll the view to the top when you click on the status bar, by default Yes

-(BOOL) Scrollviewshouldscrolltotop: (Uiscrollview *) ScrollView;

When the call is rolled to the top, it may be called immediately if the

-(void) Scrollviewdidscrolltotop: (Uiscrollview *) ScrollView;

Waterfall Flow Implementation Principle

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.