当按下菜单项时,它会改变其外观。 在我看来是这样的: 你知道有什么方法可以摆脱这个吗? 如果不行的话有办法改变颜色吗? 例如,将颜色从黑色更改为蓝色。
底部导航查看项目:
<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>
---指标样式--- 1)
<style name="App.Custom.Indicator" parent="Widget.Material3.BottomNavigationView.ActiveIndicator">
<item name="android:color">@color/blue</item>
</style>
app:itemActiveIndicatorStyle="@style/App.Custom.Indicator"
或
app:itemRippleColor="@color/green"
app:itemActiveIndicatorStyle="@color/green"
制作爆炸的“动画”。 颜色类型并不重要。