【问题标题】:How can i set padding to BottomSheetScaffold in jetpack compose我如何在 Jetpack Compose 中将填充设置为 BottomSheetScaffold
【发布时间】:2022-12-03 14:43:16
【问题描述】:

I want to set the start and end padding to BottomSheetScaffold but as you can see, the borromsheet has extra color in the background and has not had good ui. How can i set padding to bottomsheet?

 BoxWithConstraints() {
            val maxHeight = maxHeight
            val sheetHeight = maxHeight / 4.dp
            BottomSheetScaffold(
                modifier = modifier
                    .statusBarsPadding()
                    .navigationBarsPadding(),
                scaffoldState = scaffoldState,
//                sheetShape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp),
                sheetContent = {
                   
                },
                sheetBackgroundColor = Color.Unspecified,
                sheetPeekHeight = 51.dp
            ) {
                Box(modifier = modifier
                    .fillMaxSize()) {
                    Column(modifier = modifier
                        .fillMaxSize()) {
                      
                        Box(modifier = modifier
                            .weight(1f)
                            .background(Color.Cyan)) {
                          
                        }
                    }
                }
            }
        }

    标签: android android-jetpack-compose bottom-sheet


    【解决方案1】:
    猜你喜欢
    • 2022-10-22
    • 1970-01-01
    • 2023-03-23
    • 1970-01-01
    • 2022-10-16
    • 2021-09-22
    • 1970-01-01
    • 2021-06-11
    • 1970-01-01
    相关资源
    最近更新 更多