admin管理员组

文章数量:1429954

While trying to fix this problem, I found exactly the same bug in another question on stackoverlow - How to disable BottomSheetScaffold Bounce/Jump effect when sheet is full expanded (in the video I have absolutely the same behavior)

However we have some differences, for example I use ModalBottomSheet instead of BottomSheetScaffold and my code for my component looks like this:

@Composable
@OptIn(ExperimentalMaterial3Api::class)
fun AppBottomSheet(
    modifier: Modifier = Modifier,
    sheetState: SheetState,
    shape: Shape = RoundedCornerShape(topStart = 12.dp, topEnd = 12.dp),
    onDismiss: () -> Unit,
    content: @Composable ColumnScope.() -> Unit
) {
    ModalBottomSheet(
        modifier = modifier,
        onDismissRequest = onDismiss,
        sheetState = sheetState,
        tonalElevation = 0.dp,
        containerColor = colorPalette.baseModal,
        shape = shape,
        dragHandle = null,
        windowInsets = WindowInsets(0, 0, 0, 0)
    ) {
        Column(
            modifier = Modifier
                .fillMaxWidth()
                .padding(start = 16.dp, end = 16.dp, bottom = 30.dp)
                .navigationBarsPadding()
                .animateContentSize()
        ) {
            Spacer(modifier = Modifier.height(10.dp))
            Box(
                modifier = Modifier
                    .size(height = 4.dp, width = 32.dp)
                    .clip(RoundedCornerShape(100.dp))
                    .background(colorPalette.neutral4)
                    .align(alignment = Alignment.CenterHorizontally)
            )
            Spacer(modifier = Modifier.height(15.dp))
            content()
        }
    }
}

Are there any solutions that would help solve this problem?

本文标签: