简体   繁体   中英

Android emulator - screenOrientation ignored

I have android:screenOrientation="portrait" set for my activity. Creating an AVD with resolution 800x480 and running my activity, the GLSurfaceView is created with dimensions 800x480 (ie. not rotated and width > height). I would expect it to be created with dimensions 480x800 and be rotated 90 degrees.

Is this a bug in the emulator or am I wrong in my interpretation of android:screenOrientation?

i believe android:screenOrientation="portrait" is just a constraint for your layout to keep portrait even when you rotate the emulator (Hit Ctrl+F11)

to get a layout with a landscape portrait, easily create a layout-land folder in your projectname/res/ (the sam hierarchy level with layout folder) and put your XML with landscape design into the layout-land folder. The XML name should exact between both the layout and layout-land folder

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM