本文介绍了在Android上的TabLayout下方删除阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用TabLayout(在常规布局中定义,而不是作为工具栏或操作栏的一部分)定义的选项卡下的阴影.
I'm trying to remove the shadow below tabs while using TabLayout, which is defined in a normal layout (and not as a part of a toolbar or actionbar).
将主题设置为
<item name="android:windowContentOverlay">@null<item/>
或
<item name="windowContentOverlay">@null<item/>
没有工作.
此外,将标高设置为0也无济于事.
Also, setting elevation to 0 didn't help either.
<android.support.design.widget.TabLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@android:color/white"
app:backgroundTint="@android:color/transparent"
app:tabIndicatorColor="@android:color/transparent"
app:tabMode="scrollable"/>
推荐答案
我假设您的TabLayout
位于AppBarLayout
内部,该阴影随AppBarLayout
一起提供,请将此app:elevation="0dp"
添加到该小部件中,我相信你很好.
I'm assuming your TabLayout
is inside AppBarLayout
, that shadow comes with AppBarLayout
, add this app:elevation="0dp"
to that widget and I believe you're good to go.
这篇关于在Android上的TabLayout下方删除阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!