【发布时间】:2020-02-17 19:37:54
【问题描述】:
我在 LinearLayout 中有四个垂直排列的按钮。
我希望按钮之间的空间以及最顶部按钮和线性布局顶部之间的空间以及最底部按钮和布局底部之间的空间相同。
在附图中,空格被描绘为红色路径。 我希望所有空间都具有相同的大小。
我将如何实现我的目标?
<LinearLayout
p1:orientation="vertical"
p1:layout_width="wrap_content"
p1:layout_height="wrap_content"
p1:id="@+id/mainButtonLayout">
<Button
p1:text="xxx"
p1:layout_width="match_parent"
p1:layout_height="wrap_content"
p1:id="@+id/saButton"
p1:textColor="#FFFFFF"
p1:background="@drawable/roundedBlue"
p1:minHeight="33dp"
p1:minWidth="175dp"
p1:layout_marginBottom="20dp" />
<Button
p1:text="xxxx"
p1:layout_width="match_parent"
p1:layout_height="wrap_content"
p1:id="@+id/rButton"
p1:textColor="#FFFFFF"
p1:background="@drawable/roundedBlue"
p1:minHeight="33dp"
p1:minWidth="175dp"
p1:layout_marginBottom="20dp" />
<Button
p1:text="xxxxx"
p1:layout_width="match_parent"
p1:layout_height="wrap_content"
p1:id="@+id/sButton"
p1:textColor="#FFFFFF"
p1:background="@drawable/roundedBlue"
p1:minHeight="33dp"
p1:minWidth="175dp"
p1:layout_marginBottom="20dp" />
<Button
p1:text="xxxxx"
p1:layout_width="match_parent"
p1:layout_height="wrap_content"
p1:id="@+id/pButton"
p1:textColor="#FFFFFF"
p1:background="@drawable/roundedBlue"
p1:minHeight="33dp"
p1:minWidth="175dp" />
</LinearLayout>
【问题讨论】:
标签: android android-layout button android-linearlayout