Android five ways to hide the status bar and title bar

Android five ways to hide the status bar and title bar

Method 1:

Method 2:

Method 3:

Method 4: dynamically display and hide the status bar

Method 5: dynamically display and hide the status bar

The view class provides setsystemuivisibility and getsystemuivisibility methods, which can dynamically display or hide the status bar and obtain the current visibility of the status bar.

Argument analysis passed in by setsystemuivisibility method:

Setsystemuivisibility (int visibility) method can pass in the following arguments:

1. View.SYstem_ UI_ FLAG_ Visible: the status bar is displayed, and the activity is not displayed in full screen (restored to the normal condition with status). 2. View.invisible: hide the status bar, and the activity will be displayed in full screen. 3. View.SYstem_ UI_ FLAG_ Fullscreen: the activity is displayed in full screen, and the status bar is hidden and overwritten. 4. View.SYstem_ UI_ FLAG_ LAYOUT_ Fullscreen: the activity is displayed in full screen, but the status bar will not be hidden or overwritten. The status bar is still visible, and the top layout of the activity will be covered by the status. 5. View.SYstem_ UI_ FLAG_ LAYOUT_ HIDE_ Navigation: the effect is the same as that of view.system_ UI_ FLAG_ LAYOUT_ FULLSCREEN 6. View.SYstem_ UI_ LAYOUT_ Flags: the effect is the same as that of view.system_ UI_ FLAG_ LAYOUT_ FULLSCREEN 7. View.SYstem_ UI_ FLAG_ HIDE_ Navigation: hide virtual keys (navigation bar). Some phones use virtual keys instead of physical keys. 8. View.SYstem_ UI_ FLAG_ LOW_ Profile: the status bar is in low-energy display state (low profile mode), and some icons on the status bar will be hidden.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>