I have look for some solution how to change a drawableLeft icon size on a button?, but it's not work for me .
My button layout:
<RelativeLayout
android:id="@+id/twoButtonLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#eceef5"
android:visibility="visible">
<Button
android:id="@+id/goToPersonalPage"
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_marginLeft="31dp"
android:drawableLeft="@drawable/drawable_left_green"
android:paddingLeft="18dp"
android:drawablePadding="-10dp"
android:background="@drawable/button_oval"
android:text="ICon"
android:textColor="#29395e"
android:textSize="18dp" />
<Button
android:id="@+id/logOutPersonal"
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_marginRight="30dp"
android:background="@drawable/button_oval"
android:text="@string/logOut"
android:textColor="#29395e"
android:textSize="18dp" />
</RelativeLayout>
I adjust the size of button by drawable_left_green.xml
:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
// I think it should be more smaller if i set 15sp.
<item
android:drawable="@mipmap/ic_launcher"
android:width="15sp"
android:height="15sp"
/>
</layer-list >
When i compile the project it (photo2)doesn't look like the preview layout(photo1):
I can't figure out why it's happen like this , some one can teach me how to fix it ? Any help would be appreciated , thanks in advance.