摆脱BottomNavigationView“选定”视图

问题描述 投票:0回答:1

当按下菜单项时,它会改变其外观。 在我看来是这样的: 你知道有什么方法可以摆脱这个吗? 如果不行的话有办法改变颜色吗? 例如,将颜色从黑色更改为蓝色。

底部导航查看项目:

    <com.google.android.material.bottomappbar.BottomAppBar
        android:id="@+id/bottomAppBar"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:layout_gravity="bottom"
        style="@style/Widget.MaterialComponents.BottomAppBar.Colored"
        >
        <com.google.android.material.bottomnavigation.BottomNavigationView
            android:id="@+id/bnv"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            app:labelVisibilityMode="unlabeled"
            app:itemIconTint="@color/white"
            app:menu="@menu/bottom_menu"

            />
    </com.google.android.material.bottomappbar.BottomAppBar>
java android-studio mobile bottomnavigationview
1个回答
0
投票

---指标样式--- 1)

 <style name="App.Custom.Indicator" parent="Widget.Material3.BottomNavigationView.ActiveIndicator">
        <item name="android:color">@color/blue</item>  
    </style>
  1. 将此行添加到 BottomNavigationView xml 代码中:
app:itemActiveIndicatorStyle="@style/App.Custom.Indicator"

   app:itemRippleColor="@color/green"
    app:itemActiveIndicatorStyle="@color/green"

制作爆炸的“动画”。 颜色类型并不重要。

© www.soinside.com 2019 - 2024. All rights reserved.