作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在处理 jectpack compose
在安卓应用程序中。所以我想使用 bottomAppbar
.从来没有找到任何例子有人可以帮忙吗?
最佳答案
与 1.0.x
您可以使用 BottomAppBar
BottomAppBar (backgroundColor = yellow500) {
IconButton(onClick = { /* doSomething() */ }) {
Icon(Icons.Filled.Menu,"")
}
// The actions should be at the end of the BottomAppBar
Spacer(Modifier.weight(1f, true))
IconButton(onClick = { /* doSomething() */ }) {
Icon(Icons.Filled.Favorite,"")
}
IconButton(onClick = { /* doSomething() */ }) {
Icon(Icons.Filled.Call,"")
}
}
val fabShape = CircleShape
val scaffoldState = rememberScaffoldState()
val scope = rememberCoroutineScope()
Scaffold(
scaffoldState = scaffoldState,
drawerContent = { Text("Drawer content") },
topBar = { },
bottomBar = {
BottomAppBar(cutoutShape = fabShape) {
IconButton(
onClick = {
scope.launch { scaffoldState.drawerState.open() }
}
) {
Icon(Icons.Filled.Menu,"")
}
}
},
floatingActionButtonPosition = FabPosition.Center,
isFloatingActionButtonDocked = true,
floatingActionButton = {
FloatingActionButton(
shape = fabShape,
onClick = {}
) {
Icon(Icons.Filled.Add,"")
}
}, content = {
//bodyContent()
})
关于android - Jetpack Compose BottomNavBar 吗?如何使用 bottomNavbar 任何示例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58574274/
我正在处理 jectpack compose在安卓应用程序中。所以我想使用 bottomAppbar .从来没有找到任何例子有人可以帮忙吗? 最佳答案 与 1.0.x您可以使用 BottomAppBa
我想要一个底部导航栏,但选项卡应该是纯文本的。问题是,该图标是 BottomNavigationBarItem() 的必需属性。 编辑:我使用标签栏作为底部导航栏让它工作,但@Fernando Roc
我试图实现jetpack compose bottomnavbar。但是我遇到了这个问题。每当标签没有足够的空间时,它就会与图标重叠。我错过了什么吗?是否有任何解决方案,例如自动截断或缩小文本? co
我对导航组件如何适应应用程序行为感到有点困惑。在教程中,一切看起来都不错而且 Shiny ,您不会做太复杂的事情,但在实际应用程序中实现时,情况似乎有所不同。 导航前 在实现导航之前,我必须手动运行
我是一名优秀的程序员,十分优秀!