Fit image inside button

0

Does anyone know how I fit the image to the size of the button without it being cut?

Button:

<Buttonandroid:id="@+id/funcionario"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="30dp"
    android:layout_marginRight="30dp"
    android:text="| Ver Funcionários"
    android:background="@drawable/botoes"
    android:drawableLeft="@drawable/funcionario"
    android:drawableTint="#ffff"/>
    
asked by anonymous 18.02.2018 / 14:18

1 answer

-1

Using the padding attribute should solve your problem.

<Button
    android:id="@+id/funcionario"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="30dp"
    android:layout_marginRight="30dp"
    android:padding="10dp"
    android:text="| Ver Funcionários"
    android:background="@drawable/botoes"
    android:drawableLeft="@drawable/funcionario"
    android:drawableTint="#ffff"/>

This link can help you understand how padding works and how it differs from margin link

    
18.02.2018 / 17:02