开发者

Android emulator - screenOrientation ignored

开发者 https://www.devze.com 2023-01-09 15:33 出处:网络
I have android:screenOrientation=\"portrait\" set for my activity. Creating an AVD with resolution 800x480 and running my activity, 开发者_StackOverflow中文版the GLSurfaceView is created with dimensio

I have android:screenOrientation="portrait" set for my activity. Creating an AVD with resolution 800x480 and running my activity, 开发者_StackOverflow中文版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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号