0
我已閱讀Android支持多屏幕教程。 當我試圖看到我的佈局如何適應不同的屏幕,出現了問題。在我的情況下,我只有一個圖像(970x174)的測試圖像被複制到所有可繪製文件夾中。 通過在不同的屏幕上看到我的佈局,在大多數情況下,佈局並不像我想的那樣。我貼我的佈局代碼(這很符合的Nexus 4屏幕)在不同的屏幕設備上修改的部件距離
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/TEMPORARY"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="128dp"
android:src="@drawable/button" />
<ImageView
android:id="@+id/image2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="64dp"
android:src="@drawable/button" />
<ImageView
android:id="@+id/image3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:src="@drawable/button" />
</RelativeLayout>
也許我應該爲每個屏幕類型做了不同密度的形象?
如果我刪除一個或多個文件夾,當我不同的屏幕上測試我的佈局,一些屏幕看上去是空的,只有對應於繪製密度文件夾屏幕葉,是顯示 – giozh
您是否嘗試過只用繪製/文件夾,也許你使用太限制限定符,更多信息在http://developer.android.com/guide/topics/resources/providing-resources.html#Compatibility –
是的,我試過了,但是發生了我說的 – giozh