'Drawer usage in Compose Material3
Is there a way to have the menu overlap the header and footer here?
I am using androidx.compose.material3.Scaffold and NavigationDrawer.
It seems like the Scaffold's drawer slot is removed - https://android-review.googlesource.com/c/platform/frameworks/support/+/1896804 so the instructions at https://developer.android.com/jetpack/compose/layouts/material?hl=hu#drawers no longer apply.
Solution 1:[1]
The workaround is using material.Scaffold instead of material3.Scaffold to get the drawerContent slot and the result is what is expected. I just need to manually specify my Material3 theme color roles for the scaffold which applies to the drawer as well:
Scaffold(
...
drawerBackgroundColor = MaterialTheme.colorScheme.surface,
drawerContentColor = MaterialTheme.colorScheme.surface,
drawerScrimColor = DrawerDefaults.scrimColor,
backgroundColor = MaterialTheme.colorScheme.background,
contentColor = MaterialTheme.colorScheme.background
) { ... }
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gabor |

