【问题标题】:AVD rotates 90 degrees but the screen orientation does nothingAVD 旋转 90 度,但屏幕方向没有任何作用
【发布时间】:2014-03-24 17:10:31
【问题描述】:

好的,我尝试过使用 ctrl f12、ctrl f11、7 和 9。它们都做同样的事情。他们旋转屏幕,然后我等待 30 分钟,avd 上的内容不随 avd 旋转。就像我把它锁定了,但正如你所看到的,这不是我的代码中的问题。这是一个非常基本的代码,只有屏幕上的文本。仅此而已。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.lineware.scheduler"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="org.lineware.scheduler.MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="sensor"
            android:configChanges="orientation|screenSize" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

【问题讨论】:

  • 通过设置android:configChanges="orientation|screenSize" 属性,您将自己处理屏幕尺寸和方向的变化。你在org.lineware.scheduler.MainActivityonConfigurationChanged(Configuration newConfig) 上处理得当吗?
  • 您的 AVD 上运行的是哪个 android 版本?
  • @tato.rodrigo 由于问题,我添加了它。我正在使用最新的。没找到,今天下载了所以我知道这是最新的。

标签: android eclipse avd


【解决方案1】:

这是我根据您的评论的回答:

如果您使用的是最新的 Android AVD,那么您使用的是 4.4 (KitKat)。众所周知,KitKat AVD 存在旋转问题(例如:即使模拟器旋转 90 度,它仍处于纵向模式)。

这是很多人报告的已知问题,我自己也遇到过这个问题(请参阅https://code.google.com/p/android/issues/detail?id=61671)。

我通过获取 4.3 SDK 并使用没有此错误的 Android 版本 4.3 (JellyBean) 创建了一个 AVD 来修复它。

【讨论】:

  • 太棒了,我会进一步调查。感谢您提供这些信息。
  • 你试过我的建议了吗?对你有帮助吗?
猜你喜欢
  • 1970-01-01
  • 2014-05-25
  • 1970-01-01
  • 2023-03-25
  • 2018-11-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多