How would I implement a swipe-based circular control like this?

前端 未结 10 2045
北恋
北恋 2021-01-30 23:52

I am working on an Android application, and I have a TextView where I display a price (for example 50$).

I would like to have a circular control similar to this picture:

10条回答
  •  遇见更好的自我
    2021-01-31 00:19

    Perhaps you could look into the onTouchEvent(MotionEvent) of the view. Keep a track of the x and y coordinates as you move the finger. Notice the pattern of the coordinate changes as you move the finger. You can use that to achieve the increase/decrease in the price. See this link.

提交回复
热议问题