How to draw a Line in ImageView on Android?

前端 未结 4 1662
無奈伤痛
無奈伤痛 2020-12-05 15:50

I\'d Like to know how to draw a Line on ImageView as user swipe their finger ?

Could any body explain this ? Or perhaps any Link to get start on this.

4条回答
  •  無奈伤痛
    2020-12-05 16:41

    For drawing the line the user actually drew you have to override the dispatchTouchEvent. From that event you can get the coordinates of the line and draw them in the onDraw as shown by george.

    http://developer.android.com/reference/android/app/Activity.html#dispatchTouchEvent(android.view.MotionEvent)

提交回复
热议问题