开发者

ScrollView scrolling speed

开发者 https://www.devze.com 2023-02-05 05:50 出处:网络
In my app, I have 2 ScrollView s in view.first scroll is placed bottom and then second Scroll placed. if i scroll either first or second both will scroll depends on finger movements. this is working.

In my app, I have 2 ScrollView s in view.first scroll is placed bottom and then second Scroll placed. if i scroll either first or second both will scroll depends on finger movements. this is working.

But my question is, what if I want the scrolling speed to be different for first scroll and second scroll eg. if the first scroll moves 2px speed then second scroll has to开发者_如何学运维 move double the speed of first scroll i.e 4px.

How can i solve this?


To achieve this, you don't need to work on speed, but on the contentOffset property of the scrollView. You could have a method that sets the contentOffset of other scrollViews based on a sender scrollView.

0

精彩评论

暂无评论...
验证码 换一张
取 消