我想知道喷气背包中的 Scaffold 是什么,有一个BottomAppBar 的例子,谁能帮我
Scaffold
答案 0 :(得分:1)
使用 1.0.0
(使用 1.0.0-beta07
测试)Scaffold
允许您实现具有基本 Material Design 布局结构的 UI。 Scaffold
为最常见的顶级 Material 组件提供插槽,例如 TopAppBar
、BottomAppBar
、FloatingActionButton
和 Drawer
。
类似于:
val scaffoldState = rememberScaffoldState()
// Create a coroutineScope for the animation
val coroutineScope = rememberCoroutineScope()
Scaffold(
scaffoldState = scaffoldState,
drawerContent = { Text("Drawer content") },
bottomBar = {
BottomAppBar(cutoutShape = CircleShape) {
IconButton(
onClick = {
coroutineScope.launch { scaffoldState.drawerState.open() }
}
) {
Icon(Icons.Filled.Menu, contentDescription = "....")
}
}
},
floatingActionButton = {
ExtendedFloatingActionButton(
text = { Text("Action") },
onClick = { /* .... */ }
)
},
floatingActionButtonPosition = FabPosition.Center,
isFloatingActionButtonDocked = true,
content = { innerPadding ->
//....
}
)