导航栏上方的android Q内容 [英] android Q content above navigation bar
问题描述
我们将应用程序定位在api 28并在状态栏下绘制内容.为此,我们使用以下标志和样式:
we are targeting our application at api 28 and draw content under status bar. For this we are using following flag and styles :
window.addFlags(FLAG_LAYOUT_NO_LIMITS)
<item name="windowNoTitle">true</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
在Android Pie上一切正常(状态栏下方和导航栏上方的内容布局).在android Q中,导航栏是半透明的,并显示在应用程序内容上
everything is okay on Android Pie (content layout under status bar and above navigation bar). In android Q, navigation bar is translucent and shows over the application content
推荐答案
问题"是FLAG_LAYOUT_NO_LIMITS行为的基础,并结合了api 29中的新手势功能
the "problem" underlies the behavior of the FLAG_LAYOUT_NO_LIMITS, mixed with the new gesture functionality in api 29
https://medium.com/androiddevelopers/gesture导航到边缘到边缘812f62e4e83e https://medium.com/androiddevelopers/gesture-navigation-handling- visual-overlaps-4aed565c134c
一个小解决方案是:
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
window.statusBarColor = Color.TRANSPARENT
不要设置
android:fitsSystemWindows
android:windowTranslucentStatus
android:windowIsTranslucent
这篇关于导航栏上方的android Q内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!