如何设置底部导航的高度

2024-02-19

所以由support V25。我们有一个名为底部导航的新组件。

遵循设计指南、底部导航elevation应该8dp (https://material.io/guidelines/components/bottom-navigation.html#bottom-navigation-specs https://material.io/guidelines/components/bottom-navigation.html#bottom-navigation-specs)

但我无法设置elevation to it.

任何建议、例子将不胜感激。谢谢你!

更新 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"/>

所以,现在(25.1.0)我们必须设置android:backgroundBNV 至@android:color/white有影子。如果您设置为其他颜色(即您的原色),它将不会显示

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何设置底部导航的高度 的相关文章

随机推荐