Wednesday, January 14, 2015

How to create a Button with text and image in Android

activity_main.xml code snippet

<!--put android.png image from res/drawable resource folder-->
<Button
 android:id ="@+id/push_button"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:text="Button With Text and Image"
 android:drawableLeft="@drawable/android"
 android:padding="15dp"
 />

More android examples