如何让BottomSheetScaffold中的TopAppBar透明?我希望汉堡图标和应用程序名称覆盖在地图上方。设置backgroundColor为透明并不起作用,无论alpha值是多少。使用的Compose版本为1.0.5。
这是脚手架代码:
BottomSheetScaffold(
topBar = {
TopAppBar(
title = { Text("App") },
backgroundColor = Color.Transparent.copy(alpha = 0.1f),
navigationIcon = {
IconButton(onClick = {
scope.launch {
bottomSheetScaffoldState.drawerState.apply {
if (isClosed) open() else close()
}
}
}) {
Icon(Icons.Default.Menu, "Open/Close menu")
}
}
)
},
scaffoldState = bottomSheetScaffoldState,
drawerGesturesEnabled = false,
drawerContent = {
DrawerContent(actions) {
scope.launch {
bottomSheetScaffoldState.drawerState.apply {
close()
}
}
}
},
floatingActionButton = {
FloatingActionButton(
onClick = {
},
backgroundColor = MaterialTheme.colors.secondary,
modifier = Modifier.padding(bottom = 100.dp),
) {
Icon(Icons.Filled.Add, contentDescription = "Add")
}
},
sheetContent = {
},
sheetPeekHeight = 0.dp,
) {
MapScreen(viewModel = viewModel)
}