我有一个ModalBottomSheet
,里面有一个LazyColumn
项目列表。当我快速向上或向下滚动(即快速滚动)该LazyColumn
内容时,底部工作表会短暂地从底部或顶部分离(取决于滚动方向)。我想删除这种行为,以便我的ModalBottomSheet
牢牢地粘在底部和顶部(它是全屏底部工作表)。
有谁知道如何实现这一目标?:)
我正在使用此依赖项中当前最新的底表:
androidx.compose.material3:material3-android:1.2.0-alpha02
我删除了很多内容代码,但一般来说底部工作表内容是这样的:
@Composable
fun BottomSheetContent() {
Column(modifier = modifier.fillMaxSize()) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
.verticalScroll(rememberScrollState())
.weight(1f)
) {
GenresSection(
selectedGenres = selectedGenres,
)
}
ResetAllAndApplyFilterButtonsRow(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 16.dp, horizontal = 16.dp)
)
}
}
@Composable
fun GenresSection(
selectedGenres: List<Genre>,
modifier: Modifier = Modifier,
) {
LazyColumn(
modifier = modifier.height(400.dp),
) {
items(selectedGenres) { genre ->
GenreChoiceRow(
text = genre.name,
modifier …
Run Code Online (Sandbox Code Playgroud)