Created
December 10, 2017 20:32
-
-
Save tw-Frey/7de2e822e78f2eb944d83a57b2df4ab7 to your computer and use it in GitHub Desktop.
各種樣式 Flag 的使用記錄
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. default | |
| /* 系統預設樣式 */ | |
| 2. use SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN|SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | |
| /* 在 Android 5.x 切換 theme 可能會有殘影 */ | |
| getWindow().getDecorView().setSystemUiVisibility( | |
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE | |
| | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | |
| | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | |
| ); | |
| 3. use FLAG_TRANSLUCENT_STATUS|FLAG_TRANSLUCENT_NAVIGATION | |
| /* 半透 bar */ | |
| getWindow().addFlags( | |
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | |
| | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION | |
| ); | |
| 4. use FLAG_LAYOUT_NO_LIMITS | |
| /* 全透 bar */ | |
| getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment