Android splash screen Hide status bar full screen display

Source: Internet
Author: User

1. At the root office give an ID, then directly set on the line layout.setsystemuivisibility (view.invisible);

The status bar is gone.

2. If you just want to change the status bar color, you can also

5.0 before this
  If  (build.version.   Sdk_int   >= Build.version_codes.   KITKAT   &&build.version.   sdk_int   <build.version_codes.   LOLLIPOP  )   {Settranslucentstatus ( true );   Systembartintmanager Tintmanager =  new  systembartintmanager ( this );   Tintmanager.setstatusbartintenabled ( true ); Tintmanager.setstatusbartintresource (R.color.   top_bg_color  ); //  the desired color of the notification bar } 
   Settranslucentstatus (on) {   Window win = GetWindow ();   Windowmanager.layoutparams winparams = Win.getattributes ();    bits = windowmanager.layoutparams. flag_translucent_status;    (ON) {      winparams.| = bits;    {      winparams.  &= ~bits;   }   Win.setattributes (winparams);}
   5.0 later such  (build.version.  >= Build.version_codes. LOLLIPOP) {   window window = GetWindow ();   Window.clearflags (windowmanager.layoutparams.  Flag_translucent_status);   Window.addflags (windowmanager.layoutparams.  Flag_draws_system_bar_backgrounds);   Window.setstatusbarcolor (Getresources (). GetColor (R.color.  Top_bg_color));
}



The view class provides the setsystemuivisibility and Getsystemuivisibility methods that implement dynamic or hidden actions on the status bar, and get the current visibility of the status bar.

Setsystemuivisibility method passed in argument analysis:

The arguments that the setsystemuivisibility (int visibility) method can pass in are:

1. View.system_ui_flag_visible: Displays the status bar,

Activity is not displayed in full screen (revert to normal condition).

2. View.invisible: Hides the status bar while the activity stretches the full-screen display.

3. View.SYSTEM_UI_FLAG_FULLSCREEN:Activity full screen, and the status bar is hidden and overwritten.

4. View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN:Activity full screen, but the status bar will not be hidden, the status bar is still visible, the activity top layout part will be obscured by the state.

5. View.system_ui_flag_layout_hide_navigation: Effect with View.system_ui_flag_layout_fullscreen

6. View.system_ui_layout_flags: Effect with 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: Status bar display is in low-energy display state (low profile mode), some icons on the status bar are shown to be hidden

Android splash screen Hide status bar full screen display

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.