Hi all. I'm working with ModalBottomSheet, and I'...
# compose
m
Hi all. I'm working with ModalBottomSheet, and I'm wondering if there's any way to set an image as the background for the bottom sheet. I can set the content color and the container color, but i don't see a way to use an image. And setting a painter on the modifier for the ModalBottomSheet itself ends up applying to the entire screen (presumably because the ModalBottomSheet control is a full screen thing). I can set a painter on my content, but that will not go underneath the drag handle.
Copy code
ModalBottomSheet(
            dragHandle = {
                Box(modifier = Modifier.fillMaxWidth()) {
                    BottomSheetDefaults.DragHandle(
                        modifier = Modifier.align(Alignment.Center),
                        color = Color.White
                    )

                    IconButton(
                        modifier = Modifier.align(Alignment.CenterEnd),
                        onClick = {
                            visible = false
                        }
                    ) {
                       Icon(
                           imageVector =
                           Icons.Default.Close,
                           tint = Color.White,
                           contentDescription = "close"
                       )
                    }
                }
            },
            scrimColor = Color.LightGray,
            onDismissRequest = { visible = false },
            contentColor = Color.White,
            containerColor = Color.Blue
        ) {
            Button(onClick = { visible = false }) {
                Text("Close")
            }
        }
I'vo also tried a negative offset on the content and while it does get properly clipped to the dialog shape, it overlays the drag handle, and so that's a no go. And to be clear, i still want the drag handle visible, just over the top of the image (along with the close button i've got in there)