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?
本文标签:
版权声明:本文标题:kotlin - How to disable ModalBottomSheet bounce effect when my bottom sheet is full expanded android compose - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745554355a2663091.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论