I have created a very basic layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button"
android:drawableStart="@drawable/ic_launcher" />
</LinearLayout>
</RelativeLayout>
According to the documentation for drawableStart
,
"The drawable to be drawn to the start of the text."
However, when run on my Android 4.0.4 phone, I instead see this:
Why is there such a large gap between the icon and the text? According to this answer,
"With Android 4.0 (API level 14) you can use android:drawableStart attribute to place a drawable at the start of the text."
But this is not the behavior I observe. Why isn't the attribute working?