2

我希望我的 textView 或线性布局的背景是半透明的。我附上了一张图片作为我想要实现的示例。

半透明 http://imagecdn3.maketecheasier.com/2011/03/kde-style-oxygen-transparent.jpg

我不想使整个活动半透明,而只是其中的一个布局字段。我怎样才能得到这个?

4

3 回答 3

2

See Translucent theme, descibed here:

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

于 2012-10-26T12:14:57.023 回答
1
于 2012-10-26T12:14:09.940 回答
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/

于 2014-04-23T02:12:09.833 回答