Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

50% opacity at white background for textview

I am trying to set #ffffff(white) background at 50% opacity to TextView.
I tried to use android:alpha=0.5 but it's also making text 50% transparent.

I need to set 50% opacity at white background.
I find one tutorial Here but don't understand that much.

Please provide me any reference. Thanks in Advance.

like image 360
Sandip Armal Patil Avatar asked Nov 29 '13 17:11

Sandip Armal Patil


Video Answer


1 Answers

In your layout file just set the background of the TextView to "#8FFF"

<TextView
android:layout_width="..."
android:layout_height="..."
android:background="#8FFF"
/>

Here 8 is the alpha value, FFF are the RGB values respectivley. See here for more info on the background attribute

like image 150
taylorstine Avatar answered Oct 20 '22 17:10

taylorstine