How to completely exit from Immersive full screen mode?

前端 未结 2 1660
面向向阳花
面向向阳花 2021-02-12 20:27

I would like to implement a button to enable/disable the immersive full screen mode. I\'m using those methods but the showSystemUI only shows quickly and hide again...

H

相关标签:
2条回答
  • 2021-02-12 21:11

    What worked for me is the following:

    View decorView = activity.getWindow().getDecorView();
    decorView.setSystemUiVisibility(0);
    

    I might be wrong but it seems like calling setSystemUiVisibility with 0 clears the flags which were previously applied.

    0 讨论(0)
  • 2021-02-12 21:16

    Calling setSystemUiVisibility() with View.SYSTEM_UI_FLAG_VISIBLE clears all flags:

    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
    
    0 讨论(0)
提交回复
热议问题