How can I resize imageButton?

I want to resize my ImageButton with the mouse on the graphic layout or with the android:layout_width , android:layout_height . But whenever I do this, ImageButton does not change, in fact, no less, but it is cut along the edges.

early

+7
source share
3 answers

First try using android: background instead of android: src to set the image on the button. In most cases, this helps. If not, then see these ..

+11
source

You will need to specify fixed sizes for the buttons (use dp instead of px ). Example:

 <ImageButton android:background="@drawable/ic_menu_more" android:layout_width="50dip" android:layout_height="50dip" /> 
+2
source

This may be a problem with the size of your image. Try using the modified image, and then use it in your image button. Then you can set the width and height of the button.

+1
source

All Articles