【问题标题】:Android: remove shadow from bottom navigationAndroid:从底部导航中删除阴影
【发布时间】:2017-09-25 12:02:52
【问题描述】:

在我的底部导航下方放置一个容器时,它会被导航的灰色阴影部分覆盖,即使在向容器添加内容之后也是如此。如何去除阴影?

【问题讨论】:

  • 尝试将海拔设置为0。

标签: android android-layout bottomnavigationview


【解决方案1】:

使用 app:elevation="0dp" 隐藏底部导航的阴影

<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:background="@android:color/white"
    app:elevation="0dp"
    app:menu="@menu/bottom_navigation_main" />

【讨论】:

  • 这也会移除底部导航视图顶部的标高
  • 苏抓紧我的朋友。谢谢!
【解决方案2】:

如果您使用的是 Api-level 28 以上,则可以使用

android:outlineAmbientShadowColor="@android:color/transparent"
android:outlineSpotShadowColor="@android:color/transparent"

【讨论】:

    猜你喜欢
    • 2016-10-28
    • 2020-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多