[Android] achieves full screen and no title bar Effect

Source: Internet
Author: User

During the Android UI design, we often need to set the screen to no title bar or full screen. It is also very easy to implement. There are two main methods: Configuring the xml file and writing the code settings.
1. Configure in the xml file in the configuration file AndroidManifest. xml of the project, find the Activity that needs to be full screen or set to no title bar, and configure the Activity as follows.
Achieve full screen effect

Android: theme = "@ android: style/Theme. NoTitleBar. Fullscreen"
Implement no title bar

(But there is a built-in taskbar)

Android: theme = "@ android: style/Theme. NoTitleBar"

2. compile Java code settings and write code in the program. You only need to add the following code to the onCreate () method.
Achieve full screen effect
GetWindow (). setFlags (WindowManager. LayoutParams. FLAG_FULLSCREEN, WindowManager. LayoutParams. FLAG_FULLSCREEN );
Implement no title bar

(But there is a built-in taskbar)

RequestWindowFeature (Window. FEATURE_NO_TITLE );


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.