您好我需要在我的选项卡布局下添加阴影(如在 Skype 中)。
我的活动 xml:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar xmlns:local="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="@color/splashGreenTop"
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
local:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_below="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:elevation="0dp"
android:minHeight="?attr/actionBarSize" />
<FrameLayout
android:layout_width="match_parent"
android:layout_below="@+id/tab_layout"
android:id="@+id/tabContainer"
android:layout_height="match_parent" />
</RelativeLayout>
当我将 android:elevation="10dp"
添加到 Tablayout 时,阴影被添加到底部和顶部。我只需要底部。看图…
我怎样才能做到这一点 ?提前致谢。
原文由 puko 发布,翻译遵循 CC BY-SA 4.0 许可协议
只需将高度添加到您的
Tablayout
(0dp - 25dp)。阅读 材料设计 指南以获取有关高程的更多信息。编辑:
将它添加到您的 tablayout 和工具栏