我有像這樣在一個線性佈局2周圖像的觀點:對齊multipile圖像均勻horizontaly
<LinearLayout
style="@style/home_icon_row"
android:orientation="horizontal">
<ImageView
android:id="@+id/ibtn_home_bus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ico_bus_selector" />
<ImageView
android:id="@+id/ibtn_home_butoday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ico_butoday_selector" />
</LinearLayout>
我怎樣才能對準兩個圖像,以使得它們均勻地放置線性佈局內。類似於「對齊文本」的東西,使得它在圖像的左側和右側與屏幕的邊界具有相等的間距。
不得不承認,我可能會考慮使用「RelativeLayout」。 – trumpetlicks
可能重複:http://stackoverflow.com/questions/3470420/is-it-possible-to-evenly-distribute-buttons-across-the-width-of-an-android-linea – trumpetlicks
你可以使用之前的墊片,你的圖像之間和之後,權重爲1. – njzk2