I have a button which have both text and image. The image size it is taking as actual size of image. How can i change the size of image in button?
<Button
android:id="@+id/button3"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:drawableTop="@drawable/home_icon"
android:text="Settings"
/>
Set
android:scaleType="fitXY"
Also wrap_content is the preferred Parameter for width and height so that the OS will automatically adjust depending upon the screen size. Please refer to Android - Image Button Scale and Adjusting the size of an ImageButton in Android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With