Android hides the title bar and displays it in full screen.

Source: Internet
Author: User

 

Android 1.5 passed the test

 

You only need to call setCurrentView (); in the following code.

Http://hi.baidu.com/wishwingliao/blog/item/38feb71c994ae98587d6b6e0.html

 

 

/**
* Hide the title bar and call this method before Activity. setCurrentView ();
*/
Private void HideTitle ()
{
RequestWindowFeature (Window. FEATURE_NO_TITLE );
}

/**
* This method is called before Activity. setCurrentView (); To hide the status bar (full screen ).
*/
Private void HideStatusBar ()
{
// Hide the title
RequestWindowFeature (Window. FEATURE_NO_TITLE );
// Define full-screen parameters
Int flag = WindowManager. LayoutParams. FLAG_FULLSCREEN;
// Obtain the window object
Window myWindow = this. getWindow ();
// Set the Flag ID
MyWindow. setFlags (flag, flag );
}

========================================================== ====

 

Android full screen display

Use in Activity:

GetWindow (). addFlags (WindowManager. LayoutParams. FLAG_FULLSCREEN );

 

========================================================== ====

 

Another method is to modify AndroidManifest. xml.

No title bar ----- add android: theme = "@ android: style/Theme. NoTitleBar" to the application tag"

No title bar or status bar ----- add android: theme = "@ android: style/Theme. NoTitleBar. Fullscreen" to the application label"

 

 

 

 

 

Under normal circumstances:


 

Hide the title bar:


 

Full Screen Display:


 

Related Article

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.