I want a Button like this:
+-----------------------+
| |
| +-----+ |
| |Image| |
| +-----+ |
| Text |
| |
| |
+-----------------------+
EDIT: Explanation to the picture: I want the COMBINATION of Image and text centered (text ALWAYS below the image)
I want the Button to stretch to a parent object (to make the whole area the button click area) and still align imgage AND text at center.
I achieve only top center alignment with folowing code, but I don't get the desired behaviour...
<Button
android:id="@+id/btInfo"
android:paddingTop="20dp"
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="top|center_horizontal"
android:layout_weight="1"
android:background="@drawable/border_button_main_menu"
android:drawableTop="@drawable/bt_info"
android:onClick="onClick"
android:text="@string/info"
android:textColor="@drawable/bt_white_red_text"
android:textSize="15dp" />
changing android:gravity="top|center_horizontal"
to android:gravity="center_vertical|center_horizontal"
only leads to image centered at top and text centered at bottom...
---- EDIT2 -----
Wanted behaviour:
1) look as described (Image and text is a optical group and the group is centered in the button)
2) text should be part of the button (I want the onclick behaviour to work with selectors)
---- EDIT3 -----
added my own solution... but thanks to all that tried to help