因此,通过 support V25
,我们有了一个名为 Bottom navigation 的新组件。
遵循设计指南,底部导航的 elevation
应该是 8dp
(https://material.io/guidelines/components/bottom-navigation.html#bottom-navigation-specs)。
但我无法将 elevation
设置为它。
任何建议和示例都将不胜感激。谢谢!
更新的 XML 代码
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:elevation="8dp"
app:elevation="8dp"
app:itemBackground="@color/colorPrimary"
app:itemIconTint="@drawable/bottom_nav_color_state"
app:itemTextColor="@drawable/bottom_nav_color_state"
app:menu="@menu/bottom_navigation_main"/>
<FrameLayout
android:id="@+id/contentFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/bottom_navigation"
android:background="#EDEDED"/>