<?xml version="1.0" encoding="utf-8"?> <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:background="#E6E6E6" tools:context=".MainActivity"> <ImageView android:id="@+id/iv_head" android:layout_width="50dp" android:layout_height="50dp" android:layout_centerHorizontal="true" android:layout_marginTop="40dp" android:src="@drawable/dddss" /> <LinearLayout android:id="@+id/layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/iv_head" android:layout_margin="10dp" android:background="#ffffff" android:orientation="vertical" > <RelativeLayout android:id="@+id/rl_username" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="10dp" > <TextView android:id="@+id/tv_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:text="账号" /> <EditText android:id="@+id/et_number" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:layout_toRightOf="@+id/tv_name" android:background="@null" /> </RelativeLayout> <View android:layout_width="match_parent" android:layout_height="2dp" android:background="#E6E6E6" /> <RelativeLayout android:id="@+id/rl_userpsw" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="10dp" > <TextView android:id="@+id/tv_psw" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:text="密码" /> <EditText android:id="@+id/et_password" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:layout_toRightOf="@+id/tv_psw" android:inputType="textPassword" android:background="@null" /> </RelativeLayout> </LinearLayout> <Button android:id="@+id/btn_login" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/layout" android:layout_centerHorizontal="true" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="20dp" android:background="#3C8DC4" android:text="登录" android:textColor="#ffffff" /> </RelativeLayout>