Reputation: 93
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" />
Upvotes: 4
Views: 9814
Reputation: 412
Try this, set the text color as your wish..Now it is red(#9a0a0a).
<Button
android:id="@+id/Button01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#9a0a0a"
android:layout_weight="0.01"
android:onClick="scanName"
android:orientation="center"
android:background="@android:color/transparent"
android:text="@string/tap to start scanning" />
Upvotes: 1