如何使选项卡布局在图像滑块上透明。。。这是我声明选项卡布局的布局。。。我搜索了很多,但没有找到任何解决方案。。。
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="150dp"
android:id="@+id/tablayout"
android:textAllCaps="false"
android:background="#db000000"
app:tabMode="fixed"
app:elevation="0dp"
app:tabGravity="fill"
app:tabTextColor="#FFFFFF"
app:tabSelectedTextColor="#EF9C1A"
android:tabStripEnabled="true"
>
</android.support.design.widget.TabLayout>
</RelativeLayout>
如图所示。。
我的应用程序是这样的
只需将其android:background
设置为#70000000
。这将使其成为半透明的。只需将70
值更改为更适合您的值即可。99变暗。10是透明(较轻)
编辑:要使其完全透明,只需使用android:background="@android:color/transparent"