整个界面我用到了线性布局。
该界面用到了Textview显示控件和EditText文本输入框显示控件
这连个控件最大的区别就是TextView就是直接引用文字,没有文本框提供用户输入
而EditText就提供了一个文本输入框供用户进行输入文字之类的。
EditText这个文本输入框的的控件其中有一个hint(暗示)这个属性,
这个属性可以在文本输入框中显示一些提示性的语句,指引用户在输入的信息,
当用户进行编辑的时候该提示性的语句就会自动的消失。
就这个移动云盘的项目来说,必须有账号密码的属性,所以文本输入框在定义的时候我们也赋予了他们的一些限制的属性(inputtype),
例如只能允许账号输入的时候只能接收一个邮箱的地址,在密码输入的时候只能是只能接受一个密码属性的文本输入,就是不能够带空格和不能够是中文输入的密码状态。
为了提供一个安全的属性,在定义文本输入框的时候赋予了密码的一个属性textpassword,这样当我们在输入密码的时候会自动的把你输入的密码用点来代替,大大提高了安全性。
checkbox这个控件是可勾选的喜好记住框,在java代码中可以为他赋予相应的属性,在本项目中我为了这个checkbox赋予了一个记住密码的属性,这个大大方便了用户在使用该软件的时候重复输入的麻烦。
说完checkbox,一个软件就必须还需要它自己的button控件,该控件就我个人理解来说是可以完成用户传过来的一些命令,但是命令执行的内容就需要我们程序员来自己定义。
在这个界面里面有两个Button的控件,分别控制用户的登录和注册的响应。
在checkbox和记住密码这个布局的时候我是用到了linearlayout的嵌套布局的。
该布局只是仅仅一个简单简朴的界面,后期我还会继续把界面这方面,毕竟一个app,用户第一时间的接触的不是你的功能而是你的界面,所以界面对于一个app来说也是不可忽视的一点。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
package="test.ts.wader.image"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/c"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.30"
android:text="@string/xianmu"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/zhanghao"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:inputType="textEmailAddress"
android:hint="请输入您的账号"
android:id="@+id/count"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/mima"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:inputType="textPassword"
android:hint="请输入您的密码"
android:id="@+id/password"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="86dp"
android:orientation="horizontal" >
<CheckBox
android:id="@+id/view01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/jizhumima" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="0.47"
android:text="@string/havenum"
android:textColor="#000000"/>
<Button
android:layout_width="104dp"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1.00"
android:text="@string/denglu"
android:id="@+id/button_login"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="0.23"
android:text="@string/havennum"
android:textColor="#000000"/>
<Button
android:layout_width="117dp"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1.00"
android:text="@string/zhuce"
android:id="@+id/button_sign"
/>
</LinearLayout>