In the past, the removal of the status bar and the title bar is always implemented in the form of dynamic code:
GetWindow (). SetFlags (Windowmanager.layoutparams. Flag_fullscreen, Windowmanager.layoutparams. Flag_fullscreen);
Requestwindowfeature (Window.feature_no_title);
However, in the project development, in the collection of data suddenly found a very useful API, this API is setsystemuivisibility ();
It can basically be defined as the position relationship between the status bar and the activity. The way it dynamically hides and displays the status bar is as follows:
setsystemuivisibility (int visibility) The input argument types are as follows:
1.view.system_ui_flag_visible: The status bar and activity coexist, the activity is not displayed in full screen. That is, the normal display screen is applied.
2.View.SYSTEM_UI_FLAG_FULLSCREEN:Activity full screen, and the status bar is overwritten
3. View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN:Activity full screen display, but the status bar will not be overwritten, but the normal display, but the activity top layout will be covered
4.View.INVISIBLE:Activity Full-screen display, hide status bar
The most basic usage of these four, in fact, there are some types of arguments did not describe, reckoned the actual development needs are not necessarily used, there is no need to understand, to meet the need, and then check the document usage on the line.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The position relationship between the status bar and the activity is realized through setsystemuivisibility