<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="20dp"
tools:context=".MainActivity" >
<TextView
android:id="@+id/Txttitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:gravity="center_horizontal"
android:layout_alignParentRight="true"
android:text="登录界面"/>
<EditText
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/Txttitle"
android:layout_alignRight="@id/Txttitle"
android:layout_below="@id/Txttitle"
android:layout_marginTop="20dp"
android:hint="username"/>
<EditText
android:id="@+id/password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/username"
android:layout_alignLeft="@id/username"
android:layout_alignRight="@id/username"
android:layout_marginTop="20dp"
android:hint="password"
android:inputType="textCapWords"/>
</RelativeLayout>