【发布时间】:2023-01-12 21:52:47
【问题描述】:
我只想在HalfExpandedModalBottomSheetLayout 的状态下显示我的工作表的 30% 而不是 50%。我怎样才能做到这一点?
【问题讨论】:
标签: android android-jetpack-compose material-components-android
我只想在HalfExpandedModalBottomSheetLayout 的状态下显示我的工作表的 30% 而不是 50%。我怎样才能做到这一点?
【问题讨论】:
标签: android android-jetpack-compose material-components-android
您可以通过将 Modifier 传递给定义该状态下工作表所需高度的 ModalBottomSheetLayout 来配置 HalfExpanded 状态。
ModalBottomSheetLayout(
state = state,
sheetContent = { /* content */ },
sheetPeekHeight = Modifier.preferredHeight(height)
)
height in dp(可以从屏幕高度算出30%的高度)
【讨论】: