我製作了三個同名的文件。android支持多屏和多畫圖
96 * 96 = xhigh:
72 * 72 =高:
48 * 48 =中等:
WHE n我創建了一個480 * 854(hdpi)圖片編號爲3的AVD。 爲什麼?
清單:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ex31"
android:versionCode="1"
android:versionName="1.0" >
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.ex31.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
佈局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/one"
/>
</RelativeLayout>
你肯定你的模擬器是華電國際?你指定了什麼作爲dpi值? –
是的,http://i.stack.imgur.com/zSYHu.jpg – user3103823
你確定你在hdpi文件夾中有正確的png文件嗎?右鍵單擊one.png並選擇打開。 – ramaral