界面格式如下图:
先写好登录界面的布局,记住要写一个Checkbox。
- <LinearLayout 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:orientation="vertical"
- tools:context=".MainActivity" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="请输入账号" />
- <EditText
- android:id="@+id/ed_zhanghao"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="请输入密码" />
- <EditText
- android:id="@+id/ed_mima"
- android:inputType="textPassword"
-