Transparent status bar not working with windowTranslucentNavigation=“false”

后端 未结 4 1477
悲&欢浪女
悲&欢浪女 2020-12-02 09:57

I am developing an Activity where I need to make the navigation bar opaque, and the status bar transparent on devices running 5.0+ (API 21+). The styles I am us

4条回答
  •  旧巷少年郎
    2020-12-02 10:45

    To achieve this in any activity

    1. Add the style:
     
    
    1. Use CoordinatorLayout as root layout in XML

    2. In oncreate() method, before setcontentview use

      window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN

提交回复
热议问题