Home > Mobile >  Material 3 BottomNavigationView container has wrong color
Material 3 BottomNavigationView container has wrong color

Time:09-04

I have implemented a BottomNavigationView in my activity. Per documentation app:backgroundTint changes the container color, but when I use app:backgroundTint="@android:color/white" it still gives me an awkward color. How can I make it go completely white?

enter image description here

CodePudding user response:

app:itemIconTint="@color/red"-->selected icon
app:itemRippleColor="@color/yellow"-->selected Tab Background effect
app:itemTextColor="@color/red"-->tabTextColor

<com.google.android.material.bottomnavigation.BottomNavigationView
    android:divider="@null"
    android:id="@ id/navigation"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:layout_alignParentBottom="true"
    android:background="@color/colorWhite"
    app:itemIconTint="@color/bottomnavigation_color"
    app:itemRippleColor="@color/rippleColor"
    app:itemTextColor="@color/bottomnavigation_color"
    app:menu="@menu/bottom_navigation_menu" />

CodePudding user response:

Change color from theme file because material components depends on theme file

  • Related