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