简体   繁体   English

Jetpack Compose Bottom Sheet 暗淡阴影不可见

[英]Jetpack Compose Bottom Sheet dim shadow not visible

I've created a bottom sheet in jetpack compose.我在 jetpack compose 中创建了一个底部工作表。 But when the bottom sheet is expanding, the bottom sheet outside the background does not dim as usual bottom sheets do.但是当底部工作表展开时,背景外的底部工作表不会像往常一样变暗。 Please help.请帮忙。

MyApplicationTestTheme {
    ProvideWindowInsets {
        BottomSheetScaffold(
            scaffoldState = bottomSheetScaffoldState,
            sheetShape = RoundedCornerShape(topStart = 30.dp,topEnd = 30.dp),
            sheetElevation= 5.dp,
            modifier=Modifier.fillMaxHeight(0.95f).fillMaxWidth(),
            sheetBackgroundColor=Color.Green,
            sheetContent = {
                //Bottom sheet content
            }, sheetPeekHeight = 0.dp
        ) {
         // Page Content
        }
   }
}

Bottom sheet does not have a default dim feature.底部工作表没有默认的暗淡功能。

You can use ModalBottomSheetLayout , or BottomDrawer to have that effect.您可以使用ModalBottomSheetLayoutBottomDrawer来实现这种效果。 But neither these layout have peek height, only expand states.但是这些布局都没有透视高度,只有展开状态。

    ModalBottomSheetLayout(
        sheetState = modalBottomSheetState,
        sheetElevation = 8.dp,
        sheetContent = {
            SheetContent()
        }
    ) {
        MainContent(modalBottomSheetState)
    }

Or或者

    val drawerState = rememberBottomDrawerState(BottomDrawerValue.Closed)

    BottomDrawer(
        gesturesEnabled = gesturesEnabled,
        drawerState = drawerState,
        drawerContent = {

        },
        content = {
   
        }
    )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM