Expand clickable area of an ImageView by using padding?

后端 未结 4 892
小蘑菇
小蘑菇 2021-02-04 02:19

I have an ImageView, and I want it to be clickable. The image itself is only 32x32 pixels, but I want the clickable region to be larger so it\'s easier to hit. I was hoping I co

4条回答
  •  半阙折子戏
    2021-02-04 02:46

    Use like below; where width/height is your touch radius

    
    

    In the above code, I wanted my src size to be viewed as 24dp width/height. And touch radius of 32dp. so I had used padding of 8dp.

提交回复
热议问题