Android: make a scrollable custom view

前端 未结 3 1527
春和景丽
春和景丽 2021-01-02 13:28

I\'ve rolled my own custom view and can draw to the screen alright, but what I\'d really like to do is set the measuredHeigh of the screen to, say, 1000px and let the user s

3条回答
  •  渐次进展
    2021-01-02 14:28

    If you want to do scrolling on your own, you can use a Scroller and a VelocityTracker while overriding the onTouchEvent method of your custom view. To help you implement it I recommend looking through the Javadocs of these classes and taking a look at android widgets implementations that do scrolling like the NumberPicker.

提交回复
热议问题