Android4.0以后
一般的全屏:
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.INVISIBLE);
此时全屏手下滑可以调出status bar和navigation button。
在源码中可以添加:
getWindow().getDecorView().setSystemUiVisibility( View.STATUS_BAR_DISABLE_EXPAND |View.STATUS_BAR_DISABLE_NOTIFICATION_ICONS |View.STATUS_BAR_DISABLE_NOTIFICATION_ALERTS |View.STATUS_BAR_DISABLE_SYSTEM_INFO | View.STATUS_BAR_DISABLE_HOME | View.STATUS_BAR_DISABLE_RECENT | View.STATUS_BAR_DISABLE_BACK | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.INVISIBLE);
此时是真正的全屏,无法调出Home等
时间: 2024-10-02 06:06:35