I am needing help importing a button in the ImageButton with a small size, because whenever I add the image to the image button, it always stays too big, and I also updated to the new Android Studio, which instead of the drawable folder, it has a mipmap folder instead.
Asked
Active
Viewed 8,850 times
2
-
For the size of the imageButton just change your layout width and height to some specific values. The mipmap folder is meant for your app icon only, read this http://stackoverflow.com/questions/28065267/mipmap-vs-drawable-folders – freddieptf Apr 20 '15 at 16:01
-
OK, thanks. But also I noticed if you change the image asset, will it make it smaller, like the icon size? – TheREELLil_G1749 Apr 20 '15 at 16:05
-
Because that's what I did, and it seemed to make it not as big. – TheREELLil_G1749 Apr 20 '15 at 16:06
1 Answers
1
Try this. It will stretch the image on the button to what ever the button size is.
<ImageButton
android:width = "xx"
android:height = "xx"
android:src = "@drawable/xxx"
android:scaleType="fitXY"/>

Tomer Shemesh
- 10,278
- 4
- 21
- 44