想做横屏时全屏,导航栏和状态栏不显示,但位置还在,
结构:DrawerLayout > FrameLayout > WebView 直接用的
getWindow().getDecorView().setSystemUiVisibility()
设置的

解决方案 »

  1.   

    顶部绿色栏?
    1:webView加载的url有没有
    2: android:theme="@style/AppTheme",theme是否用错
    3:全屏--getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                   WindowManager.LayoutParams.FLAG_FULLSCREEN);
      

  2.   

    1、首先去掉标题栏<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
            <!-- Customize your theme here. -->
            <item name="colorPrimary">@color/colorPrimary</item>
            <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
            <item name="colorAccent">@color/colorAccent</item>
            <item name="android:windowActionBar">true</item>
            <item name="android:windowNoTitle">true</item>
        </style>
    2、状态栏透明getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
                getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
                //需要设置这个flag contentView才能延伸到状态栏
                getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
                //状态栏覆盖在contentView上面,设置透明使contentView的背景透出来
                getWindow().setStatusBarColor(Color.TRANSPARENT);