我在縱向模式下顯示圖像,顯示正確。當我將配置更改爲橫向時,圖像不顯示。爲什麼我的圖像在橫向模式下消失?
請注意,包含ImageView
的LinearLayout
顯示正確(我通過更改背景進行了檢查)。但是當我改變了ImageView
的背景時,背景也沒有顯示出來。
<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" android:layout_weight="3">
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" android:minHeight="48dp" android:minWidth="48dp" android:src="@drawable/xyz" android:id="@+id/img"/>
添加您的佈局xml到您的答案。 – inazaruk
我想由於你的體重屬性..我知道它的neccesary ..可能在橫向模式下你的線性佈局沒有獲得適當的屏幕空間來顯示圖像,因此它隱藏了圖像。 –
但是我也在橫向屏幕中看到linearLayout的邊框。我給linearlayout添加了不同的顏色,並可以看到佈局邊框。 – sam22