android Q content above navigation bar

后端 未结 3 1761
耶瑟儿~
耶瑟儿~ 2021-01-18 08:51

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_N         


        
3条回答
  •  独厮守ぢ
    2021-01-18 09:25

    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-navigation-going-edge-to-edge-812f62e4e83e https://medium.com/androiddevelopers/gesture-navigation-handling-visual-overlaps-4aed565c134c

    a little solution is:

    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
    

    and don't set

    android:fitsSystemWindows
    android:windowTranslucentStatus
    android:windowIsTranslucent
    

提交回复
热议问题