如何在RelativeLayout
组中的视图之间添加空格?
我在使用TextView
和Button
对齐TextView
顶部的Button
后,尝试在Layout_marginBottom
和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" />
谢谢。
答案 0 :(得分:1)
试试这个。
<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"/>