Expand clickable area of an ImageView by using padding?

后端 未结 4 848
小蘑菇
小蘑菇 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:39

    Use padding. layout margins are used if for inserting space outside the boundary of the view.

    for equal padding on all sides

      
    

    or to set the padding on each side

    
    

    Hope that helps !

提交回复
热议问题