android - Android 上的透明 LinearLayout

标签 android android-linearlayout transparent

我有以下布局:

enter image description here

我想使 transparent_layout 透明,但我做不到。

已经尝试使用颜色以编程方式设置背景:Color.TRANSPARENT 但它似乎不起作用。

我正在使用带有 SherlockActionBar 的 Android 2.3.3 SDK。

有什么方法可以将该布局设置为透明吗?

最佳答案

根据你喜欢的不透明度,设置背景色

        android:background="#00ffffff"

前两位数字用于不透明度级别(又名 alpha),从 00 到 ff(完全透明到完全不透明)变化,其余数字用于所需的背景颜色。如果您将前 2 位数字保留为零 (00),那么无论您为其余数字选择什么颜色都没有关系。

关于android - Android 上的透明 LinearLayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16440762/

相关文章:

android - Android API 级别 7 中是否有 requestAudioFocus 的等效函数?

android:layout_marginBottom 底部不留空间

css - CSS 中的文本背景

android - 完全透明的 Activity ,带有 9 个补丁角图像

delphi - 如何制作带有透明图形的firemonkey按钮,并使其成为默认样式

android - 您是否尝试过在 Android 中使用缓冲区大小为 2 的幂的 Class AudioTrack?

java - 接口(interface) java/Android 不能从子 fragment 到父 fragment

java - GSON:不调用我的解串器

android - 不需要的 FrameLayout 拉伸(stretch)以包裹所有 child 的高度(而不是只考虑一个 child 的高度)

java - 在 LinearLayout 中垂直居中多个 TextView