Search code examples
androidandroid-jetpack-composeandroid-jetpack-navigationandroid-bottomnav

BottomNavigationItem doesn't adopt the material theme jetpack compose


I am migrating my app to jetpack compose and the theming and styling is giving me some headache. I have implemented Bottom Navigation as explained in this tutorial. I have also set the background color as such:

backgroundColor = MaterialTheme.colorScheme.background

but the bottom navigation items don't react to changes. The selected item is not highlighted. My expectation was that the material theme would be applied automatically. I am using Material 3.


Solution

  • My Problem was that I was using BottomNavigation and BottomNavigationItem. I switched to NavigationBar and NavigationBarItem and the design is now adjusted based upon the MaterialTheme.