Skip to content Skip to sidebar Skip to footer

Android Button With Transparent Text

I have a button on an image. I would like to have this button with a solid background color and transparent text (to display the back image). Is it possible to make it have only tr

Solution 1:

Try adding these attributes to your Button:

android:textColor="@android:color/transparent"
android:background="@android:color/black"

Solution 2:

By transparent do you mean like partially visible. Also look into the image button instead of assigning the background image to a button.

Solution 3:

This sounds like it may be a use case for an ImageButton. It allows specifying an Image and a background. Notice the src and background tags, txt is not required.

<ImageButton
    android:id="@+id/imageBtn"
    android:layout_width="@dimen/btn_large_len"
    android:layout_height="@dimen/btn_large_len"
    android:src="@drawable/ic_action_play"
    android:background="@drawable/btn_gray" >
</ImageButton>

Post a Comment for "Android Button With Transparent Text"