界面格式如下图:
![](https://img-blog.csdn.net/20151212221615778?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
先写好登录界面的布局,记住要写一个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"
-