Friends,
I want to display a button in android like mentioned in screenshot.
Could anyone guide me through how to achieve this?
Friends,
I want to display a button in android like mentioned in screenshot.
Could anyone guide me through how to achieve this?
Use a normal Butto with drawableLeft
attribute. See my sample code:
<Button android:layout_width="100dip"
android:layout_height="wrap_content"
android:text="Refresh"
android:drawableLeft="@drawable/ic_btn_refresh"
android:id="@+id/btn_refresh" />
You could use 9-patch fot background. You can specify padding area there (bottom and right lines), so background will be stretchable while text will not cover image. :)
There is the ImageButton which you can use for that.
But I'm not sure how to make the Text on the button look like the Text in your screenshot. I would simply create the image with the text and then use it for the ImageButton
.
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/refresh"
android:text="Refresh"/>