0
我不知道怎麼一個可能對齊兩個或更多的UI元素在屏幕的底部,而不是他們的只是堆積,因爲他們通常做。Android的佈局:移動項目
我不知道怎麼一個可能對齊兩個或更多的UI元素在屏幕的底部,而不是他們的只是堆積,因爲他們通常做。Android的佈局:移動項目
事情是這樣的:
<RelativeLayout
android:id="@+id/myBottomLayout"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentBottom="true">
<View
android:id="@+id/leftItem"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<View
android:id="@+id/rightItem"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toRightOf="id/leftItem">
</RelativeLayout>
但我想放置在頂部的其他事情。我可以用這個XML來做到這一點嗎? – Mitchell 2010-09-25 17:19:35
當然,我忘了提及這段代碼假設父元素也是一個RelativeLayout。要對齊到頂部,請將其他元素對齊到頂部。這將工作,如果父元素是一個RelativeLayout。 – lheezy 2010-09-25 20:25:39