Home > Net >  How to change the drawer container color of ModalNavigationDrawer in Jetpack Compose?
How to change the drawer container color of ModalNavigationDrawer in Jetpack Compose?

Time:08-24

I just updated material3 dependency to:

implementation "androidx.compose.material3:material3:1.0.0-alpha16"

And:

drawerContainerColor = Color.Red

Doesn't work anymore. I tried to set:

scrimColor = Color.Red

But the color is not changed? How to change the content color?

CodePudding user response:

You can use drawerContainerColor in the ModalDrawerSheet

ModalNavigationDrawer(
    drawerState = drawerState,
    drawerContent = {
        ModalDrawerSheet (drawerContainerColor=Red){
            //..
        }
    }
    //...
 )

enter image description here

  • Related