我遵循了Android文檔(http://developer.android.com/guide/practices/screens_support.html)中提供的指導原則,並創建了36x36像素,48x48像素和72x72像素的圖像按鈕,然後在ldpi,mdpi,hdpi文件夾中加入了這些...但是當我在Eclipse中更改xml-layout-creation地點的屏幕分辨率時...圖像按鈕大小不斷變化:(Android,圖像按鈕不是密度獨立的
是否有其他設置我應該改變
我的XML是非常簡單的,例如:
<ImageButton android:src="@drawable/level1"
android:layout_width="wrap_content" android:id="@+id/imageButton1"
android:layout_height="wrap_content"
android:onClick="button_clicked1">
(完整的文件:http://pastebin.com/nyh2BMFE)
請指教!好吧,添加Android在每個directry中創建的默認圖標,並且該按鈕的縮放效果也不像其他按鈕那麼好。
在頂部添加了編輯評論,不確定其相關... – Ryan
就像我提到的那樣,放入各種dpi文件夾並不能保證它們會一樣。最好使用比例進行佈局,並將圖像縮放到正確比例(以代碼形式)。 – sparkymat