想做橫屏時全屏,導航欄和狀態欄不顯示,但位置還在,
結構:DrawerLayout > FrameLayout > WebView
直接用的
getWindow().getDecorView().setSystemUiVisibility()
設定的
uj5u.com熱心網友回復:
頂部綠色欄?1:webView加載的url有沒有
2: android:theme="@style/AppTheme",theme是否用錯
3:全屏--getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
uj5u.com熱心網友回復:
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);
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/84470.html
標籤:Android
