日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

[:zh]<界面编程>任务二 用户注册界面设计[:]2018-01-24

發(fā)布時(shí)間:2025/3/15 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [:zh]<界面编程>任务二 用户注册界面设计[:]2018-01-24 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

(1)EditText控件詳解

編輯框使用EditText表示,作用是在屏幕上顯示文本輸入框。編輯框可以輸入單行文本,也可以輸入多行文本,還可以指定是的文本(如密碼、電話號(hào)碼、日期等)。編輯框的基本語(yǔ)法格式如下。

<EditText屬性列表/>
XML屬 性 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?說(shuō)明
? android: hint為空時(shí)顯示的文字提示信息,可通過(guò)textColorHint設(shè)置提示信息的顏色
android:inputType設(shè)置文本的類型,用于幫助輸入法顯示合適的鍵盤類型。有如下值設(shè)置:none、text、textCapCharacters字母大小、textCapWords單詞首字母大小、textAutoComplete自動(dòng)完成、phone電話號(hào)碼、datetime時(shí)間日期、date日期、time時(shí)間等
android:password以小點(diǎn).顯示文本
android:phoneNumber設(shè)置為電話號(hào)碼的輸入方式

(2)文字填空題(1 分)

//在空白處填入適當(dāng)代碼,使編輯框?yàn)榭諘r(shí)默認(rèn)顯示“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表示,作用是在屏幕上顯示一個(gè)按鈕。按鈕的基本語(yǔ)法格式如下。

<Button

????????屬性列表

/>

(4)文字填空題(1 分)

在空白處填入適當(dāng)代碼,使按鈕顯示文字“點(diǎn)擊”。<Buttonandroid:layout_width="fill_parent"android:layout_height="wrap_content"______________></Button> ANSWER:android:text="點(diǎn)擊"

(5)實(shí)戰(zhàn)代碼、視頻、截圖

5.1界面編程實(shí)戰(zhàn)1:實(shí)戰(zhàn)視頻

5.2相應(yīng)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="注冊(cè)新用戶"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="請(qǐng)?zhí)顚懙顷戀~號(hào)"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="電話號(hào)碼:"android:textSize="10pt"/><EditTextandroid:layout_width="match_parent"android:layout_height="wrap_content"android:hint="請(qǐng)?zhí)顚懩碾娫捥?hào)碼"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="請(qǐng)?zhí)顚懩愕某錾掌?#34;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="注 冊(cè)"/></LinearLayout> </LinearLayout><!--author CYJ 2018-01-22 -->

(6)源碼鏈接

往期鏈接:<Android界面編程>? 任務(wù)一 ??醬油詩(shī)詞賞析?

總結(jié)

以上是生活随笔為你收集整理的[:zh]<界面编程>任务二 用户注册界面设计[:]2018-01-24的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。