如何在 RelativeLayout 中的视图之间添加 space
how to add space between views in RelativeLayout
如何在 RelativeLayout
组的视图之间添加 spaces?
在使用 [=17= 对齐 Button
顶部的 TextView
之后,我试图在 TextView
和 Button
之间添加一个 space ] 和 paddingBottom
但没有一个有效。
代码如下:
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text=" Drawing ... "
android:gravity="center_horizontal"
android:layout_alignTop="@id/reset"
android:layout_marginBottom="50dp" />
<Button
android:id="@+id/reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:onClick="reset"
android:text="Reset" />
谢谢。
试试这个。
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text=" Drawing ... "
android:gravity="center_horizontal"
android:layout_above="@+id/reset"
android:layout_marginBottom="15dp"/>
<Button
android:id="@+id/reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="reset"
android:text="Reset"
android:layout_alignParentBottom="true"/>
如何在 RelativeLayout
组的视图之间添加 spaces?
在使用 [=17= 对齐 Button
顶部的 TextView
之后,我试图在 TextView
和 Button
之间添加一个 space ] 和 paddingBottom
但没有一个有效。
代码如下:
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text=" Drawing ... "
android:gravity="center_horizontal"
android:layout_alignTop="@id/reset"
android:layout_marginBottom="50dp" />
<Button
android:id="@+id/reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:onClick="reset"
android:text="Reset" />
谢谢。
试试这个。
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text=" Drawing ... "
android:gravity="center_horizontal"
android:layout_above="@+id/reset"
android:layout_marginBottom="15dp"/>
<Button
android:id="@+id/reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="reset"
android:text="Reset"
android:layout_alignParentBottom="true"/>