Get the touch position inside the imageview in android

后端 未结 2 992
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 20:22

I have a imageview in my activity and I am able to get the position where the user touch the imageview, through onTouchListener. I placed another image where the user touch

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 21:22

    Add these lines to ImageView

    android:scaleType="fitXY" 
    

    and

    android:adjustViewBounds="true"
    

    to your image view it is because image are not having their original dimensions in IV

提交回复
热议问题