admin管理员组文章数量:1278983
I'm trying to achieve a docked FAB in combination with a BottomBar
using Material3 components.
I'm able to add the FAB (centred), the BottomBar having a NavigationBar
and apply the cut-out to the BottomBar.
I'm also able to shift the FAB correctly but unfortunately, the entire FAB can only occupy the space above the BottomBar and not be drawn above it.
Are there any possible solutions?
If relevant, my setup:
Scaffold(
bottomBar = {
NavigationBar(
modifier = Modifier.fillMaxWidth()
.clip(backgroundShape)
.background(Color.White, backgroundShape),
containerColor = Color.White,
tonalElevation = 0.dp,
) { [...] },
floatingActionButton = {
FloatingActionButton(
elevation = FloatingActionButtonDefaults.elevation(
defaultElevation = 10.dp
),
shape = RoundedCornerShape(50),
containerColor = Colors.brandOrange,
contentColor = Color.White,
onClick = { },
modifier = Modifier
.zIndex(1f)
.clip(RoundedCornerShape(50))
.absoluteOffset(y = 50.dp) // tried with and without zIndex, and with and without absolute (offset only)
) {
Box(modifier = Modifier.size(56.dp), contentAlignment = Alignment.Center) {
Icon(
modifier = Modifier.size(24.dp),
imageVector = Icons.Default.Add,
contentDescription = null,
tint = Color.White,
)
}
}
},
floatingActionButtonPosition = FabPosition.Center,
本文标签: androidScaffold (Material3) with Navigation Bar and Docked FABStack Overflow
版权声明:本文标题:android - Scaffold (Material3) with Navigation Bar and Docked FAB - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741213976a2359685.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论