[英]how to set buttons in bottom with half width of page for a linear layout enclosed in relative layout?
為此,您必須使用layout_weight
屬性。
在您的LinearLayout
這種方式設置。
<LinearLayout
android:id="@+id/btnLinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<Button
android:id="@+id/prevButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Prev" />
<Button
android:id="@+id/nextButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Next"/>
</LinearLayout>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.