屏幕方向横向回到纵向不起作用

Screen orientation landscape back to portrait not working(屏幕方向横向回到纵向不起作用)

本文介绍了屏幕方向横向回到纵向不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为这个问题绞尽脑汁了好几个小时.我创建了一个 main.xml 并设计了一个用于 res/layout-land(横向)格式,另一个用于 res/layout 中的纵向.

I've racked my brain for hours over this issue. I have created a main.xml and designed one for the res/layout-land (landscape) format and another one for portrait in res/layout.

当我旋转模拟器 (ctrl-F11) 时,我的应用会使用正确的 main.xml 正确旋转到横向,但随后旋转回纵向只会保留横向 mail.xml.

When I rotate the emulator (ctrl-F11), my app rotates properly to landscape using the correct main.xml, but a subsequent rotation back to portrait just keeps the landscape mail.xml.

这是在 2.0 AVD 中完成的.

This was done in a 2.0 AVD..

出于绝望,我下载了新的多分辨率示例代码并不得不创建一个新的 2.1 AVD,令我惊讶的是,这个应用程序的轮换按预期正常工作.所以我决定在 2.1 AVD 上试用我的应用程序,它运行良好.

Out of despiration I downloaded the new Sample Code for Multiple Resolutions and had to create a new 2.1 AVD, to my surprise rotation with this app works correctly as expected. So I then decided to try my app on the 2.1 AVD and it works perfectly.

那么,这是 2.0 AVD 中的错误还是我需要为 < 做一些特别的事情?2.1 SDK 版本?

So, is this a Bug in a 2.0 AVD or is there something special I need to be doing for < 2.1 SDK versions?

这让我发疯了,因为没有人在哪里提到这个问题.

This is driving me crazy because no where did anyone mention this issue.

提前致谢

推荐答案

FWIW,官方报告为bug 这里.

FWIW, it's officially reported as bug here.

这篇关于屏幕方向横向回到纵向不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:屏幕方向横向回到纵向不起作用

基础教程推荐