Is there any way to set the color and background image for a button? I want a green button with a transparent .png but it seems you can only have one or the other.
(Don't) Use an ImageView
Set your set your green button background image as the background, and your transparent png as the src. You can apply a selector to the background just the same as you would to a button also...
EDIT: Actually there is an ImageButton already made for this, you should be using that instead. Slipped my mind.
Try This piece of code it works for me :)
<ImageButton
android:id="@+id/button5"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
...
android:src="@drawable/settingbtn"
android:background="@drawable/red_color"
/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With