【问题标题】:Android emulator not tack right layoutAndroid 模拟器没有调整正确的布局
【发布时间】:2013-06-16 21:08:20
【问题描述】:

我创建了一个 3 布局 HDPI、MDPI、IDPI。在系统android模拟器中我创建了3个模拟器 但同时它会选择正确的,

我在画布高清手机中对其进行了测试,但是在手机中它仅采用正常布局, 为什么手机不采用 HDPI 布局?

在我的 Android 清单中

 <supports-screens
    android:anyDensity="true"
    android:smallScreens="true"
    android:largeScreens="true"
    android:normalScreens="true"
 />   

【问题讨论】:

  • 你能告诉我你的项目结构吗?看我的回答stackoverflow.com/questions/15090752/…
  • 但是canvas HD (480*800) 屏幕密度,这意味着它是HDIP。但是正常的屏幕密度是(320*480)。但是为什么它粘在正常的屏幕上......
  • 你走错了路。如果你声明layout目录,它支持所有normal屏幕。不管是small,medium,high 还是extra high 密度。请仔细阅读 Android 开发者网站多屏支持。

标签: android android-emulator


【解决方案1】:

你能试着把它放在你的 AndroidManifest.xml 中

    <compatible-screens>

    <!-- all small size screens -->
    <screen
        android:screenDensity="ldpi"
        android:screenSize="small" />
    <screen
        android:screenDensity="mdpi"
        android:screenSize="small" />
    <screen
        android:screenDensity="hdpi"
        android:screenSize="small" />
    <screen
        android:screenDensity="xhdpi"
        android:screenSize="small" />
    <!-- all normal size screens -->
    <screen
        android:screenDensity="ldpi"
        android:screenSize="normal" />
    <screen
        android:screenDensity="mdpi"
        android:screenSize="normal" />
    <screen
        android:screenDensity="hdpi"
        android:screenSize="normal" />
    <screen
        android:screenDensity="xhdpi"
        android:screenSize="normal" />
</compatible-screens>

支持屏幕

    <supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:resizeable="true"
    android:smallScreens="true" >
</supports-screens>

【讨论】:

    猜你喜欢
    • 2012-08-25
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    • 2019-07-19
    • 2011-12-15
    • 1970-01-01
    • 2016-05-04
    • 2018-02-10
    相关资源
    最近更新 更多