Fixed Screen Display in Android development!

Source: Internet
Author: User

When I learned the jetboy code, I found that the screen was rotated. The scanning Code did not find the relevant settings and found the relevant code in manifest. xml:
Java code
<Manifest xmlns: Android = "http://schemas.android.com/apk/res/android"
Package = "com. example. Android. jetboy" Android: versioncode = "1"
Android: versionname = "1.0.0">
<Application Android: icon = "@ drawable/icon"
Android: Label = "@ string/app_name"
Android: theme = "@ Android: style/theme. notitlebar">
<Activity Android: Name = ". jetboy"
Android: Label = "@ string/app_name"
Android: screenorientation = "portrait"
>
<Intent-filter>
<Action Android: Name = "android. Intent. Action. Main"/>
<Category
Android: Name = "android. Intent. Category. launcher"/>
</Intent-filter>
</Activity>
</Application>

<Uses-SDK Android: minsdkversion = "4"> </uses-SDK>
<! --
<Uses-library Android: Name = "android. Test. Runner"/>
<Instrumentation
Android: Name = "android. Test. instrumentationtestrunner"
Android: targetpackage = "com. example. Android. jetboy"
Android: functionaltest = "true" Android: Label = "jetboy test all runner"/>
<Uses-Permission Android: Name = "android. Permission. run_instrumentation"/>
-->
</Manifest>

<Manifest xmlns: Android = "http://schemas.android.com/apk/res/android"
Package = "com. example. Android. jetboy" Android: versioncode = "1"
Android: versionname = "1.0.0">
<Application Android: icon = "@ drawable/icon"
Android: Label = "@ string/app_name"
Android: theme = "@ Android: style/theme. notitlebar">
<Activity Android: Name = ". jetboy"
Android: Label = "@ string/app_name"
Android: screenorientation = "portrait"
>
<Intent-filter>
<Action Android: Name = "android. Intent. Action. Main"/>
<Category
Android: Name = "android. Intent. Category. launcher"/>
</Intent-filter>
</Activity>
</Application>

<Uses-SDK Android: minsdkversion = "4"> </uses-SDK>
<! --
<Uses-library Android: Name = "android. Test. Runner"/>
<Instrumentation
Android: Name = "android. Test. instrumentationtestrunner"
Android: targetpackage = "com. example. Android. jetboy"
Android: functionaltest = "true" Android: Label = "jetboy test all runner"/>
<Uses-Permission Android: Name = "android. Permission. run_instrumentation"/>
-->
</Manifest>
Find this code: Android: screenorientation = "portrait"
Portrait indicates horizontal, and landscape indicates vertical

To make the View Interface of the activity full screen, you only need to hide the top signal bar and the title bar of the activity to hide the code in the title bar:
Requestwindowfeature (window. feature_no_title );

Code in the configuration file:
Android: theme = "@ Android: style/theme. notitlebar"

Code for hiding the signal bar:
Getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen );

Other usage:
Getwindow (). setflags (windowmanager. layoutparams. type_status_bar, windowmanager. layoutparams. type_status_bar );

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.