android ui RelativeLayout中按扭平行显示

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    >

    <TextView
        android:id="@+id/layout_textView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_marginEnd="0dp"
        android:textSize="30dp"
        android:text="欢迎你" />

    <EditText
        android:id="@+id/layout_editTextText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/layout_textView"
        android:ems="10"
        android:inputType="textPersonName"
        android:hint="请输入内容" />

    <View
        android:id="@+id/line"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true" />

    <Button
        android:id="@+id/layout_btn_sub"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/layout_editTextText"
        android:text="提交"

        android:layout_alignParentLeft="true"
        android:layout_toLeftOf="@id/line"

        ></Button>

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/layout_editTextText"

        android:layout_toRightOf="@id/line"
        android:layout_alignParentRight="true"
        android:text="重置"></Button>

</RelativeLayout>

猜你喜欢

转载自blog.csdn.net/m0_37622302/article/details/107299098