Форум для тех, кто программирует под Android
Anonymous
Как удалить перекрытие содержимого листа и навигационной панели в каркасе итогового листа?
Сообщение
Anonymous » 05 авг 2025, 09:18
I want to remove the overlapping between sheet content and navigation bar of a bottom sheet scaffold.
This is the a clip of the output:
Это мой пример кода:
Код: Выделить всё
val sheetState = rememberStandardBottomSheetState(
skipHiddenState = true,
initialValue = SheetValue.PartiallyExpanded
)
val scope = rememberCoroutineScope()
val bottomPadding = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding()
Box(
modifier = Modifier
.fillMaxSize()
// .padding(MaterialTheme.dimens.paddingMedium)
.statusBarsPadding()
.background(Color.Black)
.navigationBarsPadding()
) {
BottomSheetScaffold(
scaffoldState = rememberBottomSheetScaffoldState(bottomSheetState = sheetState),
sheetPeekHeight = 100.dp,
sheetContainerColor = MaterialTheme.colorScheme.surface,
sheetContent = {
Column(
modifier = Modifier
.fillMaxWidth()
.heightIn(min = 100.dp, max = 500.dp)
.padding(16.dp)
// .windowInsetsPadding(WindowInsets.navigationBars)
// .padding(WindowInsets.navigationBars.asPaddingValues())
) {
Text("Filters", style = MaterialTheme.typography.titleLarge)
Spacer(Modifier.height(12.dp))
Button(onClick = {
scope.launch { sheetState.expand() }
}) {
Text("Expand Fully")
}
Spacer(Modifier.height(12.dp))
Button(onClick = {
scope.launch { sheetState.partialExpand() }
}) {
Text("Collapse")
}
}
}
) { }
}
Пока я пытался использовать оконные вставки и навигационные панели, но, похоже, ничего из этого не сработало.
Подробнее здесь:
https://stackoverflow.com/questions/797 ... msheet-sca
1754374710
Anonymous
I want to remove the overlapping between sheet content and navigation bar of a bottom sheet scaffold. This is the a clip of the output: [img]https://i.sstatic.net/Jfcz7ld2.png[/img] Это мой пример кода: [code] val sheetState = rememberStandardBottomSheetState( skipHiddenState = true, initialValue = SheetValue.PartiallyExpanded ) val scope = rememberCoroutineScope() val bottomPadding = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding() Box( modifier = Modifier .fillMaxSize() // .padding(MaterialTheme.dimens.paddingMedium) .statusBarsPadding() .background(Color.Black) .navigationBarsPadding() ) { BottomSheetScaffold( scaffoldState = rememberBottomSheetScaffoldState(bottomSheetState = sheetState), sheetPeekHeight = 100.dp, sheetContainerColor = MaterialTheme.colorScheme.surface, sheetContent = { Column( modifier = Modifier .fillMaxWidth() .heightIn(min = 100.dp, max = 500.dp) .padding(16.dp) // .windowInsetsPadding(WindowInsets.navigationBars) // .padding(WindowInsets.navigationBars.asPaddingValues()) ) { Text("Filters", style = MaterialTheme.typography.titleLarge) Spacer(Modifier.height(12.dp)) Button(onClick = { scope.launch { sheetState.expand() } }) { Text("Expand Fully") } Spacer(Modifier.height(12.dp)) Button(onClick = { scope.launch { sheetState.partialExpand() } }) { Text("Collapse") } } } ) { } } [/code] Пока я пытался использовать оконные вставки и навигационные панели, но, похоже, ничего из этого не сработало. Подробнее здесь: [url]https://stackoverflow.com/questions/79722226/how-to-remove-overlapping-of-sheet-content-and-navigation-bar-in-bottomsheet-sca[/url]