Remove title bar and fullscreen

Source: Internet
Author: User

First, remove the title bar

1, in the code to achieve:
Before this method Setcontentview (R.layout.main), join:

Requestwindowfeature (window.feature_no_title);//Cancel title bar

2, in the Androidmanifest.xml to achieve:
Registering activity with the following sentence configuration can be implemented.

If you want the entire app to have no title bar, add it in application:
<application android:icon= "@drawable/icon"         android:label= "@string/app_name"         android:theme= "@android: Style/theme.notitlebar ">

If you only want an activity to have no title bar, add it in the actibvity:

<activity  android:name= ". Activity "       android:theme=" @android: Style/theme.notitlebar "></activity>

  

3. Hide Actionbar

ActionBar ActionBar = Getactionbar ();  Actionbar.hide ();  

  

second, full screen : (Remove the Information Bar, to full-screen words to add a face to the title bar to remove, and the code must be written in Setcontentview this method before, otherwise will error)

Method One:

GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

Method Two: modify in config file
Android:theme= "@android: Style/theme.notitlebar.fullscreen"

  

Method Three:

<application android:icon= "@drawable/icon"         android:label= "@string/app_name"        android:theme= "@style/ Fullscreem ">

  

PS: Use the code to remove the title bar, after the app runs, you will see a short title bar and status bar, and then the full screen (this is related to the configuration of the phone, the better the configuration, the faster it disappears), and modify the configuration file is not the case.

  

  

  

  

Remove title bar and fullscreen

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.