2012-09-25 49 views
0

我曾尝试与此devoloper link如何根据设备屏幕大小加载特定的xml布局文件?

我需要1024×768的分辨率,否则默认XML文件的设备上加载的res/layout-w1024dp-h768dp/activity_main.xml提供这些说明,所以我配置我的AVD和我的工程资源管理器看起来如下 enter image description here

我已经尝试了所有,但其没有工作对规范的AVD .. 任何人可以请帮我...

这里是清单文件

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.example.fm_player" 
android:versionCode="1" 
android:versionName="1.0" > 

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

<supports-screens android:requiresSmallestWidthDp="768" /> 

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 

<application 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme" > 
    <activity 
     android:name=".MainActivity" 
     android:label="@string/title_activity_main" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

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

</manifest> 
+0

调整密度值 – Jayabal

+0

是设备 –

+0

的实际密度张贴AndroidManifest文件 – Blackbelt

回答

1

Android可以处理文件夹名称中的两种不同分辨率吗?

您是否尝试过使用:

res/layout-sw768dp 

将采取的768长度最短,从宽度和高度?

+0

没有,还是它的加载默认XML文件:( –

+0

下一个,明显,问题是:你肯定使用的设备是正确的大小?而且你正在编译对Android SDK> 3.0的版本? –

+0

是的,我已经显示了上面的图片AVD细节 –

相关问题