[SystemUI status bar] The Android interface is displayed in full screen, the status bar is hidden, and the status bar can be pulled down to display.

In the process of application development, some applications need to be displayed in full screen and the status bar is not often displayed. The status bar can be pulled down to display and then automatically hidden.

First the renderings

The interface is displayed in full screen. The status bar is not always displayed by default. The status bar appears only after the status bar is pulled down. It is automatically hidden if there is no action.
Please add image description
Please add image description

This effect is very simple. You only need to add the following two lines of code when the activity is created (oncreate) to solve the problem.
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

example:
Insert image description here

Guess you like

Origin blog.csdn.net/tuhuanxiong/article/details/126785786