如何在jetpack compose中使导航栏完全透明?

问题描述 投票:0回答:1

我想问一下如何让导航栏变得完全透明,我已经尝试了很多解决方案,但到目前为止我所能得到的只是我的导航栏变成白色,并且仍然像这样在底部裁剪一小部分 UI。enter image description here

这是我当前使用的代码 enter image description here

android mobile android-jetpack-compose mobile-development
1个回答
0
投票

为了确保其功能,您需要申请

setDecorFitsSystemWindows

SideEffect {
    val window = (localView.context as Activity).window
    WindowCompat.setDecorFitsSystemWindows(window, false)
    window.navigationBarColor = Color.Transparent.toArgb()
}
© www.soinside.com 2019 - 2024. All rights reserved.