-1
我將兩個圖像放在一行中,它在hdpi和mdpi上運行良好,但我試圖在ldpi中打開它,佈局受到未知填充的干擾(不知道它是什麼是)如何刪除ldpi佈局中的TableLayout填充
在HDPI和MDPI(它應該如何顯示圖像正確)的LDPI
http://i.stack.imgur.com/OXw9G.png
錯誤圖像
http://i.stack.imgur.com/wR3kw.png
代碼是一樣的,但不知道在ldpi模式下發生了什麼。
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="*"
android:background="@color/Grey">
<TableRow>
<FrameLayout
android:id="@+id/inboxLargeButton"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="1">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/inbox_normal"
android:id="@+id/buttonWeddingDayCheatSheet"
android:layout_gravity="center_horizontal">
</ImageView>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="2631"
android:layout_gravity="bottom"
android:gravity="center"
android:textColor="#fff"
android:textSize="50dp" />
</FrameLayout>
<FrameLayout
android:id="@+id/outboxLargeButton"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="1">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ourbox_normal"
android:id="@+id/buttonShareFavoriteRecipe"
android:layout_gravity="center_horizontal">
</ImageView>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="0296"
android:layout_gravity="bottom"
android:gravity="center"
android:textColor="#fff"
android:textSize="50dp" />
</FrameLayout>
</TableRow>
</TableLayout>
在ldpi中,它也在圖像的子排列行中的行之間顯示額外的填充。
任何幫助?
這並不是不可能的圖像大於'ldpi'上的視覺要求,導致縮小比例。默認情況下,視圖的邊界在縮小時不會改變。嘗試將'android:adjustViewBounds =「true」'設置爲'ImageView's。 –
它的作品! :)你救了我的一天@MH。 – UsmanAzam
很高興聽到!我應該將評論移至答案讓你接受嗎? –