简体   繁体   English

Android模拟器-screenOrientation被忽略

[英]Android emulator - screenOrientation ignored

I have android:screenOrientation="portrait" set for my activity. 我为自己的活动设置了android:screenOrientation =“ portrait”。 Creating an AVD with resolution 800x480 and running my activity, the GLSurfaceView is created with dimensions 800x480 (ie. not rotated and width > height). 创建分辨率为800x480的AVD并运行我的活动,GLSurfaceView的尺寸为800x480(即,未旋转且宽度>高度)。 I would expect it to be created with dimensions 480x800 and be rotated 90 degrees. 我希望它将以480x800尺寸创建并旋转90度。

Is this a bug in the emulator or am I wrong in my interpretation of android:screenOrientation? 这是模拟器中的错误,还是我对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) 我相信android:screenOrientation =“ portrait”只是布局的约束,即使您旋转模拟器也可以保持纵向(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. 要获得带有横向肖像的布局,请在您的projectname / res /中轻松创建一个layout-land文件夹(带有layout文件夹的sam层次结构级别),然后将带有景观设计的XML放入layout-land文件夹中。 The XML name should exact between both the layout and layout-land folder XML名称应在layout和layout-land文件夹之间准确

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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