[英]What is Scaffold? Jetpack compose
I want to know what is Scaffold in jetpack compose with a BottomAppBar example can anyone help me Scaffold
我想知道jetpack中的Scaffold是什么,并带有BottomAppBar示例,任何人都可以帮助我
Scaffold
With 1.0.0
(tested with 1.0.0-rc02
) Scaffold
allows you to implement a UI with the basic Material Design layout structure.使用
1.0.0
(使用1.0.0-rc02
测试) Scaffold
允许您使用基本的 Material Design 布局结构实现 UI。 Scaffold
provides slots for the most common top-level Material components, such as TopAppBar
, BottomAppBar
, FloatingActionButton
, and Drawer
. Scaffold
为最常见的顶级 Material 组件提供插槽,例如TopAppBar
、 BottomAppBar
、 FloatingActionButton
和Drawer
。
Something like:就像是:
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 ->
//....
}
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.