Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make button background transparent yet button text visible Android

I want to make my button transparent in my java application for Android but when I use

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

It is also making the text on my button invisible and I would like to avoid that. Is there a way to make the text on my transparent button visible?

This is full code for my button:

 <Button
    android:id="@+id/Button01"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="0.01"
    android:onClick="scanName"
    android:orientation="center"
    android:background="@android:color/transparent"
    android:text="@string/tap to start scanning" />
like image 774
Bes Sa Avatar asked Aug 30 '25 17:08

Bes Sa


1 Answers

Did you try setting the android:textColor for your button ?

like image 63
gvmani Avatar answered Sep 02 '25 07:09

gvmani