Alex Rivera | Logout

android image button

Asked 2010-02-17T18:42:48.887
104

How can i create a button with no text and an image centered horizontally ? I don't want to use an ImageButton because I want to define a different backgound image

Edit
Report

1 Answer

22

just use a Button with android:drawableRight properties like this:

<Button android:id="@+id/btnNovaCompra" android:layout_width="wrap_content"
        android:text="@string/btn_novaCompra"
        android:gravity="center"
        android:drawableRight="@drawable/shoppingcart"
        android:layout_height="wrap_content"/>
answered 2013-05-03T17:15:52.400

Your Answer