Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a semi-transparent button such that button color should be visible and background should be visible

I have been trying to achieve this semi-transparent button, but I always failed on making that. I have referred many like this. But still no luck. I tried with android:color="#66FF0000" too, but it doesn't make it semi-transparent. Below is my code.

<Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:text="select"
        android:onClick="selectClick"
        android:color="#80000000" 
      />

I want this type of rectangular button with semi transparent so that blue color of button should be visible and green color of the activity should also be visible. Can someone please suggest me? In the below picture I was unable to draw green color on the button to show what exactly I want. But I guess my above explanation is understandable.

Or if the blue color is not possible to be made visible, at least I want it to look like to give a user feel that there is a button and the green color should be visible.

enter image description here

like image 991
Apparatus Avatar asked Dec 21 '22 07:12

Apparatus


1 Answers

Use

android:background="#80000000"

instead of

android:color="#80000000"

like image 80
M.J Avatar answered Jan 31 '23 07:01

M.J