Android: how to detect touch location on ImageView if the image view is scaled by matrix?

后端 未结 3 954
我在风中等你
我在风中等你 2020-12-14 03:22

I set OnTouchListener of an ImageView and implement onTouch method, but if the image is scaled using matrix, how do I calculate the location of the

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 03:51

    Try using getRawX() and getRawY(). Note that this is not adjusted for the size of the view, so you may have to offset if the app isn't fullscreen.

提交回复
热议问题