Android horizontal and vertical screen Summary
// Set it to no title bar
Java code
Requestwindowfeature (window. feature_no_title );
Requestwindowfeature (window. feature_no_title); // set it to full screen mode.
Java code
Getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen );
Getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager. layoutparams. flag_fullscreen); // set it to landscape Screen
Java code
Setrequestedorientation (activityinfo. screen_orientation_landscape );
Setrequestedorientation (activityinfo. screen_orientation_landscape); Java code
Android: screenorientation = "Landscape" // In the configuration file, set it to landscape
Android: screenorientation = "portrait" // In the configuration file, set it to portrait. Android: screenorientation = "Landscape" // In the configuration file, set it to landscape.
Android: screenorientation = "portrait" // In the configuration file, set it to the Java code of the portrait Screen
Or create the layout-land and layout-port directories under the res directory. The corresponding layout files remain unchanged, such as main. xml. Layout-land is the layout of the horizontal screen, and layout-port is the layout of the vertical screen. Other simulators will automatically find the configuration file;
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