2014-01-06 147 views
0

我製作了三個同名的文件。android支持多屏和多畫圖

96 * 96 = xhigh:

enter image description here

72 * 72 =高:

i.stack.imgur.com/SCmLV.png

48 * 48 =中等:

i.stack.imgur.com/oxX0d.png

WHE n我創建了一個480 * 854(hdpi)圖片編號爲3的AVD。 爲什麼?

i.stack.imgur.com/7kIlv.jpg

i.stack.imgur.com/1qZwA.jpg

清單:

<?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> 
+1

你肯定你的模擬器是華電國際?你指定了什麼作爲dpi值? –

+0

是的,http://i.stack.imgur.com/zSYHu.jpg – user3103823

+0

你確定你在hdpi文件夾中有正確的png文件嗎?右鍵單擊one.png並選擇打開。 – ramaral

回答

0

這樣看來,你的仿真器未設置爲正確的DPI。打開Android虛擬設備管理器並檢查hw.lcd.density是(大致)240.請記住,160的DPI是基準1x或mdpi。

它應該是這個樣子:

Emulator with hdpi

你也應該看到密度斌啓動仿真器時:

Launching hdpi emulator

+0

我的AVD:http://i.stack.imgur.com/zSYHu.jpg – user3103823

+0

我的推出很好:http://up.clip2ni.com /i/images/kq717terrlc3t8oghi11.jpg – user3103823