Fit Image in ImageButton in Android

后端 未结 8 2232
猫巷女王i
猫巷女王i 2020-11-28 01:15

I have 6 ImageButton in my activity, I set images through my code in them ( not using xml).

I want them to cover 75% of the button area. But where as some images cov

8条回答
  •  Happy的楠姐
    2020-11-28 01:44

    It worked well in my case. First, you download an image and rename it as iconimage, locates it in the drawable folder. You can change the size by setting android:layout_width or android:layout_height. Finally, we have

     
    

提交回复
热议问题