2

I want the background of my textView or Linear layout to be translucent. I have attached an image as an example of what I want to achieve.

translucent http://imagecdn3.maketecheasier.com/2011/03/kde-style-oxygen-transparent.jpg

I don't want to make the whole activity translucent but just a layout field in it. How can I get this?

Ankush
  • 791
  • 2
  • 9
  • 20

3 Answers3

2

See Translucent theme, descibed here:

http://developer.android.com/guide/topics/ui/themes.html

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
1
  1. create an activity
  2. set activity’s theme as “@android:style/Theme.Translucent” in AndroidManifest.xml
  3. that’s all

Check this for more details.

Jainendra
  • 24,713
  • 30
  • 122
  • 169
  • This will make the whole activity translucent which I don't want as I have many layouts and I only want one of them translucent – Ankush Oct 26 '12 at 12:22
0

For making the activity Completely transparent,

main.xml- android:background="@android:color/transparent"

manifest.xml- android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"

For making activity Translucent

#00FFFFFF -  Full Transparency
#10FFFFFF -  90% Transparency
#20FFFFFF -  80% Transparency
#30FFFFFF -  70% Transparency
#40FFFFFF -  60% Transparency
#50FFFFFF -  50% Transparency
#60FFFFFF -  40% Transparency
#70FFFFFF -  30% Transparency
#80FFFFFF -  20% Transparency
#90FFFFFF -  10% Transparency
#99FFFFFF -  01% Transparency

Usage- in layout.xml, android:background="20FFFFFF"

here "20" is transparency and "FFFFFF" is color Get HTML color codes from http://html-color-codes.info/

JRE.exe
  • 801
  • 1
  • 15
  • 28