https://kotlinlang.org logo
#compose
Title
# compose
e

Elena Boiko

06/03/2020, 12:08 PM
Hi 🙂 Does anyone know how we can change the width of ModalDrawerLayout?
m

matvei

06/03/2020, 12:15 PM
Hello! ModalDrawerLayout doesn't accept a modifier (it probably should), so for now if you want to restrict width of the ModalDrawerLayout, you can wrap it with the
Box(Modifier.width(yourDesiredWidth.dp))
What's your general usecase for changing width of ModalDrawerLayout? It usually should be fullscreen. Just curious
e

Elena Boiko

06/03/2020, 12:35 PM
Thanks. Tried it, but it changed the whole screen. I wonder if it is possible to change only the width of the drawerContent in ModalDrawerLayout. Tried to wrap it with the Box, but it didn't work.
m

matvei

06/03/2020, 12:43 PM
Ok, I see. I don't think it's possible now to change the size of the content, as it always will be with the background provided by
MaterialTheme
and as big as the ModalDrawerLayout itself. Please, file a bug with the feature requiest and we will try to some with smth more flexible, thanks 🙂
👍 1
e

Elena Boiko

06/03/2020, 12:49 PM
Thanks a lot 🙂
4 Views