[英]How to get Scaffold to Appear Over Top Notification Bar in Jetpack Compose?
I want my scaffold to appear over the top of the notification bar, is this possible?我希望我的脚手架出现在通知栏的顶部,这可能吗?
This is what I have (can't show much due to company policy):这就是我所拥有的(由于公司政策,不能显示太多):
I want the scaffold to go over the time and battery symbol.我想要脚手架到 go 随着时间和电池符号。
This is what I want:这就是我要的:
The above image is from Google Developers documentation site: https://developer.android.com/jetpack/compose/layouts/material#modal-drawers上图来自 Google Developers 文档站点: https://developer.android.com/jetpack/compose/layouts/material#modal-drawers
My code:我的代码:
Scaffold(
scaffoldState = scaffoldState,
topBar = {
TopBarComposable() // Where you see the Edit button is bottom right
},
drawerContent = {
DrawerContentComposable()
},
content = {
ContentComposable() // The main screen thats under the Top Bar Composable
},
bottomBar = { BottomBarComposable() },
drawerShape = RectangleShape
)
Any help would be greatly appreciated!任何帮助将不胜感激!
Use WindowCompat.setDecorFitsSystemWindows
使用
WindowCompat.setDecorFitsSystemWindows
// Turn off the decor fitting system windows, which allows us to handle insets, including IME animations
WindowCompat.setDecorFitsSystemWindows(window, false)
Source: Now In Android来源:现在在 Android
Refer here for more details.有关详细信息,请参阅此处。
Note, you also have to handle padding manually.请注意,您还必须手动处理填充。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.