1. 程式人生 > >Navigation虛擬按鍵的隱藏

Navigation虛擬按鍵的隱藏

int newUiOptions = 0;
if (Build.VERSION.SDK_INT >= 14)
    newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;

if (Build.VERSION.SDK_INT >= 16)
    newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;

if (Build.VERSION.SDK_INT >= 18)
    newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;

getWindow().getDecorView
().setSystemUiVisibility(newUiOptions);