Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jetpack Compose TopAppBar flickers after setting BottomNavView with Navigation component

Working on a Jetpack Compose app with a BottomNavigationView and Navigation component, I did the usual setup for the bottom bar inside the activity:

val navHostFragment =
        supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
val navController = navHostFragment.navController
navigationView.setupWithNavController(navController)

In each screen I am using a composable TopAppBar. Unfortunately, after adding the setupWithNavController call, the TopAppBar started flickering in all the navigation bar destinations (but not in deeper destinations).

How can I fix the flickering?

like image 590
Andrei Mesh Avatar asked Sep 03 '25 05:09

Andrei Mesh


1 Answers

I got the same issue. What helped, to my surprise, was lowering androidx.navigation:navigation-compose version to 2.4.0-alpha04.

like image 91
Artur Popławski Avatar answered Sep 04 '25 20:09

Artur Popławski