Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何将表格布局背景设置为透明_Android_Tabs - Fatal编程技术网

Android 如何将表格布局背景设置为透明

Android 如何将表格布局背景设置为透明,android,tabs,Android,Tabs,我需要将TabLayout(扩展水平滚动视图)背景更改为透明,而不更改样式的原色。 如果我将背景设置为#00000000,它将成为primaryColor。如果我将alpha设置为0-我会得到相同的行为 有没有办法在不改变样式和颜色的情况下将背景色设置为透明的?如果您使用的是请使用: android:background="@android:color/transparent" 也在AppBarLayout中。 要删除阴影以使外观更好,可以使用以下方法删除AppBarlayout的立面

我需要将TabLayout(扩展水平滚动视图)背景更改为透明,而不更改样式的原色。 如果我将背景设置为#00000000,它将成为primaryColor。如果我将alpha设置为0-我会得到相同的行为


有没有办法在不改变样式和颜色的情况下将背景色设置为透明的?

如果您使用的是

请使用:

 android:background="@android:color/transparent"
也在AppBarLayout中。 要删除阴影以使外观更好,可以使用以下方法删除AppBarlayout的立面:

 app:elevation="0dp"
试试这个

<android.support.design.widget.TabLayout
    android:id="@+id/tabs"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:alpha="0.3"
    android:background="@android:color/black"
    android:hapticFeedbackEnabled="true"/>


它对我很有用。

尝试在background@android:color/transparentIt的链接上设置此选项,链接到#00000000,颜色与我在xml文件中的颜色相同。将完整的xml布局@onCreate
如果我将背景设置为#00000000,它将成为primaryColor。
否。它是透明的(意思是不可见的)。因此,你能看穿它。因此,您可以看到家长的。。。背景色,你有没有想过?我遇到了这个。在styles.xml中设置全局背景色似乎会覆盖在
表格布局上设置的任何背景
 app:elevation="0dp"
<android.support.design.widget.TabLayout
    android:id="@+id/tabs"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:alpha="0.3"
    android:background="@android:color/black"
    android:hapticFeedbackEnabled="true"/>