任务二 用户注册界面设计
生活随笔
收集整理的這篇文章主要介紹了
任务二 用户注册界面设计
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
(1)EditText控件詳解
編輯框使用EditText表示,作用是在屏幕上顯示文本輸入框。編輯框可以輸入單行文本,也可以輸入多行文本,還可以指定是的文本(如密碼、電話號碼、日期等)。編輯框的基本語法格式如下。
<EditText屬性列表/>
| XML屬 性 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | 說明 |
| ? android: hint | 為空時顯示的文字提示信息,可通過textColorHint設置提示信息的顏色 |
| android:inputType | 設置文本的類型,用于幫助輸入法顯示合適的鍵盤類型。有如下值設置:none、text、textCapCharacters字母大小、textCapWords單詞首字母大小、textAutoComplete自動完成、phone電話號碼、datetime時間日期、date日期、time時間等 |
| android:password | 以小點.顯示文本 |
| android:phoneNumber | 設置為電話號碼的輸入方式 |
|
|
(2)文字填空題(1 分)
//在空白處填入適當代碼,使編輯框為空時默認顯示“Hello World”。<EditTextandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:textColor="#DDDDDD"_________________android:id ="@+id/et"android:maxLength = "10"/ ></EditText/ > ANSWER:android:hint="Hello World"(3)Button按鈕用法
按鈕使用Button表示,作用是在屏幕上顯示一個按鈕。按鈕的基本語法格式如下。
<Button
????????屬性列表
/>
(4)文字填空題(1 分)
在空白處填入適當代碼,使按鈕顯示文字“點擊”。<Buttonandroid:layout_width="fill_parent"android:layout_height="wrap_content"______________></Button> ANSWER:android:text="點擊"
(5)實戰代碼、視頻、截圖
5.1界面編程實戰1:實戰視頻
5.2相應XMl代碼:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical" android:layout_width="match_parent"android:layout_height="match_parent"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:gravity="center_horizontal"android:orientation="vertical"><TextViewandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="注冊新用戶"android:gravity="center_horizontal"android:textSize="12pt"android:textStyle="bold"/></LinearLayout><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="用戶名:"android:textSize="10pt"/><EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:hint="請填寫登陸賬號"android:selectAllOnFocus="true"android:id="@+id/editText" /><TextViewandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="密碼:"android:textSize="10pt"/><EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:password="true"/><TextViewandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="電話號碼:"android:textSize="10pt"/><EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:hint="請填寫您的電話號碼"android:phoneNumber="true"android:selectAllOnFocus="true"/><TextViewandroid:layout_width="match_parent"android:layout_height="wrap_content"android:text="出生日期:"android:textSize="10pt"/><EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:hint="請填寫你的出生日期"android:inputType="date"android:selectAllOnFocus="true"/><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:gravity="center_horizontal"><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="注 冊"/></LinearLayout> </LinearLayout><!--author CYJ 2018-01-22 -->
(6)源碼鏈接
往期鏈接:<Android界面編程>? 任務一 ??醬油詩詞賞析?
總結
以上是生活随笔為你收集整理的任务二 用户注册界面设计的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何用Python探究你喜爱的歌手?大数
- 下一篇: 程序员山洞开发程序,两年敲45万行代码,