I have the following problem: I want to make drawable image larger. This is the screenshot: Screenshot
My code in this button in activity.xml
<Button
android:id="@+id/btnSoccer"
android:layout_width="480dp"
android:layout_height="100dp"
android:textSize="32dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:background="@drawable/button_state_background_categories"
android:drawablePadding="-220dp"
android:drawableStart="@drawable/icon_soccer_3"
android:paddingLeft="60dp"
android:text="@string/Fútbol"
android:textStyle="bold"
android:textAlignment="center"
android:textColor="@color/black" />
This is the custom button:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/rounded_corner_button_categories_pressed"/>
<!-- pressed -->
<item android:state_focused="true"
android:drawable="@color/button_focused"/> <!-- focused -->
<item android:drawable="@drawable/rounded_corner_button_categories"/> <!--
default -->
</selector>
Thanks!
You can try the xml attribute android:scaleType="fitXY"