Several ways to hide the status bar and title bar from Android

Source: Internet
Author: User

1, in Android, sometimes we want to hide our status bar and title bar (such as: the first time to install the app when the Welcome interface), to achieve these effects there are several ways to choose your favorite can.

2,

A: Using the code implementation, in our main activity in the OnCreate () method to add

1 // get the current form 2 Final window window = getWindow (); 3 // Hide the status bar 4 window.setflags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 5 // Hide title bar 6 requestwindowfeature (window.feature_no_title);

B: Add hidden themes in <Activity> in the <application> tab in the manifest file Androidmanifest.xml file

1 android:theme= "@android: Style/theme.notitlebar.fullscreen"

C: Hide the title bar in all activity and add the following topics to <application> in the manifest file Androidmanifest.xml file

1 android:theme= "@android: Style/theme.notitlebar"

D: Another way to hide the title bar in activity with code

Get ActionBar Manager Object, hide actionbar= getactionbar (); Actionbar.hide ();

Several ways to hide the status bar and title bar from Android

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.