我有一組需要在屏幕頂部設置的10個圖像視圖。在肖像模式下,它是完美的按照要求。但是當我將屏幕方向轉爲橫向時,圖像數量保持不變,但寬度明顯不符合佈局。我的意思是一組10個圖像視圖只填充了屏幕的50%。一組圖像視圖不適合橫向模式
我試過很多不同的方式,但還是我沒有能夠做到這一點景觀
,這裏是我的xml說main.xml中
<RelativeLayout android:id="@+id/relativeLayout1"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_alignParentTop="true"
android:id="@+id/progresslayout"
android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageView android:src="@drawable/progressgreen" android:id="@+id/pb1"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:layout_alignParentLeft="true"></ImageView>
<ImageView android:src="@drawable/progressgreen" android:id="@+id/pb2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"></ImageView>
<ImageView android:src="@drawable/progressgreen" android:id="@+id/pb3"
android:layout_height="wrap_content"
android:layout_width="wrap_content"></ImageView>
<ImageView android:src="@drawable/progressgreen" android:id="@+id/pb4"
android:layout_toRightOf="@+id/pb3" android:layout_height="wrap_content"
android:layout_width="wrap_content"></ImageView>
<ImageView android:src="@drawable/progressgreen" android:id="@+id/pb5"
android:layout_height="wrap_content"
android:layout_width="wrap_content"></ImageView>
<ImageView android:src="@drawable/progressgreen" android:id="@+id/pb6"
android:layout_height="wrap_content"
android:layout_width="wrap_content"></ImageView>
<ImageView android:src="@drawable/progressgreen" android:id="@+id/pb7"
android:layout_height="wrap_content"
android:layout_width="wrap_content"></ImageView>
<ImageView android:src="@drawable/progressgreen" android:id="@+id/pb8"
android:layout_height="wrap_content"
android:layout_width="wrap_content"></ImageView>
<ImageView android:src="@drawable/progressgreen" android:id="@+id/pb9"
android:layout_height="wrap_content"
android:layout_width="wrap_content"></ImageView>
<ImageView android:src="@drawable/progressgreen" android:id="@+id/pb10"
android:layout_height="wrap_content"
android:layout_width="wrap_content"></ImageView>
</LinearLayout>
</RelativeLayout>
我試圖讓機器人:layout_weight =」「財產也仍然沒有用。我注意到這裏有趣的是,而不是圖像視圖,如果我嘗試提交一些按鈕或編輯文本同樣的事情,它工作正常進行縱向和橫向
你的LinearLayout寬度和高度也應該是這樣的android:layout_width = 「FILL_PARENT」 機器人:layout_height = 「FILL_PARENT」 –
@Padma庫馬爾,我已經試過了 – tejas