How to achieve full screen in Android, remove title bar effect

Source: Internet
Author: User

In the Android UI design, we often need to set the screen to no title bar or full screen. It is very simple to implement, and there are two main ways to do this: Configure the XML file and write code settings.

1. Configuring in an XML file

In the project's manifest file Androidmanifest.xml, find the activity that needs to be full-screen or set to an untitled bar, where the activity is configured as follows.

To achieve full-screen effects:
Android:theme= "@android: Style/theme.notitlebar.fullscreen"
Implement a untitled bar (but with the system's own taskbar):
Android:theme= "@android: Style/theme.notitlebar"
2. Writing Code settings
Write code in the program to set, just add the following code in the OnCreate () method to
To achieve full-screen effects:
GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Implement a untitled bar (but with the system's own taskbar):
Requestwindowfeature (Window.feature_no_title);
Attached: Android system comes with style
Android:theme= "@android: Style/theme.dialog" displays an activity as a dialog box mode
Android:theme= "@android: Style/theme.notitlebar" does not display the application title bar
Android:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and full screen
Android:theme= "Theme.light" background is white
Android:theme= "Theme.Light.NoTitleBar" white background with no title bar
Android:theme= "Theme.Light.NoTitleBar.Fullscreen" white background, no title bar, fullscreen
Android:theme= "Theme.black" background black
Android:theme= "Theme.Black.NoTitleBar" black background with no title bar
Android:theme= "Theme.Black.NoTitleBar.Fullscreen" black background, no title bar, fullscreen
Android:theme= "Theme.wallpaper" with system desktop for application background
Android:theme= "Theme.Wallpaper.NoTitleBar" uses the system desktop as the application background with no title bar
Android:theme= "Theme.Wallpaper.NoTitleBar.Fullscreen" with system desktop for application background, no title bar, fullscreen
Android:theme= "translucent" Transparent background
Android:theme= "Theme.Translucent.NoTitleBar" Transparent background with no title
Android:theme= "Theme.Translucent.NoTitleBar.Fullscreen" Transparent background with no caption, fullscreen
Android:theme= "Theme.panel" Panel style display
Android:theme= "Theme.Light.Panel" tablet style display

How to achieve full screen in Android, remove title bar effect

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.