最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android實(shí)現(xiàn)注冊(cè)界面

 更新時(shí)間:2022年04月24日 10:04:25   作者:hansy2015  
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)注冊(cè)界面,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了Android實(shí)現(xiàn)注冊(cè)界面的具體代碼,供大家參考,具體內(nèi)容如下

LinearLayout 控制布局
TextView 用于顯示文字
EditText 輸入框
RadioGroup 單選按鈕和RadioButton一起用
CheckBox 復(fù)選框
Spinner 下拉框

源碼:

register.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">
? ? <LinearLayout
? ? ? ? android:layout_width="match_parent"
? ? ? ? android:layout_height="wrap_content"
? ? ? ? >
? ? ? ? <TextView
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:layout_marginLeft="6dp"
? ? ? ? ? ? android:layout_marginTop="10dp"
? ? ? ? ? ? android:text="用戶名:"
? ? ? ? ? ? android:textSize="15dp"
? ? ? ? ? ? android:textColor="@color/colorPrimary"
? ? ? ? ? ? />
? ? ? ? <EditText
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:layout_marginLeft="6dp"
? ? ? ? ? ? android:layout_marginTop="10dp"
? ? ? ? ? ? android:hint="輸入2-10個(gè)字符"
? ? ? ? ? ? android:textColor="@color/colorPrimary"
? ? ? ? ? ? android:layout_weight="1"/>

? ? </LinearLayout>

? ? <LinearLayout
? ? ? ? android:layout_width="match_parent"
? ? ? ? android:layout_height="wrap_content"
? ? ? ? >
? ? ? ? <TextView
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:layout_marginLeft="6dp"
? ? ? ? ? ? android:layout_marginTop="10dp"
? ? ? ? ? ? android:text="密碼: ? ?"
? ? ? ? ? ? android:textSize="15dp"
? ? ? ? ? ? android:textColor="@color/colorPrimary"
? ? ? ? ? ? />
? ? ? ? <EditText
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:layout_marginLeft="6dp"
? ? ? ? ? ? android:layout_marginTop="10dp"
? ? ? ? ? ? android:hint="輸入6-10個(gè)字符"
? ? ? ? ? ? android:textColor="@color/colorPrimary"
? ? ? ? ? ? android:layout_weight="1"/>
? ? </LinearLayout>

? ? <LinearLayout
? ? ? ? android:layout_width="match_parent"
? ? ? ? android:layout_height="wrap_content"
? ? ? ? >
? ? ? ? <TextView
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:layout_marginLeft="6dp"
? ? ? ? ? ? android:layout_marginTop="23dp"
? ? ? ? ? ? android:text="性別選擇: ? ?"
? ? ? ? ? ? android:textSize="15dp"
? ? ? ? ? ? android:textColor="@color/colorPrimary"
? ? ? ? ? ? />
? ? ? ? <RadioGroup
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:orientation="horizontal"
? ? ? ? ? ? android:layout_marginLeft="10dp"
? ? ? ? ? ? android:layout_marginTop="10dp">
? ? ? ? ? ? <RadioButton
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:layout_marginLeft="30dp"
? ? ? ? ? ? ? ? android:layout_marginTop="6dp"
? ? ? ? ? ? ? ? android:text="男"/>
? ? ? ? ? ? <RadioButton
? ? ? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? ? ? android:layout_marginLeft="30dp"
? ? ? ? ? ? ? ? android:layout_marginTop="6dp"
? ? ? ? ? ? ? ? android:text="女"/>

? ? ? ? </RadioGroup>
? ? </LinearLayout>
? ? <LinearLayout
? ? ? ? android:layout_width="match_parent"
? ? ? ? android:layout_height="wrap_content">
? ? ? ? <TextView
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:layout_marginLeft="5dp"
? ? ? ? ? ? android:layout_marginTop="6dp"
? ? ? ? ? ? android:textSize="15dp"
? ? ? ? ? ? android:text="愛好選擇:"
? ? ? ? ? ? android:textColor="@color/colorPrimaryDark"/>
? ? ? ? <CheckBox
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:layout_marginTop="6dp"
? ? ? ? ? ? android:layout_marginLeft="20dp"
? ? ? ? ? ? android:text="游泳"/>
? ? ? ? <CheckBox
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:layout_marginTop="6dp"
? ? ? ? ? ? android:layout_marginLeft="20dp"
? ? ? ? ? ? android:text="打球"/>
? ? ? ? <CheckBox
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:layout_marginTop="6dp"
? ? ? ? ? ? android:layout_marginLeft="20dp"
? ? ? ? ? ? android:text="看書"/>
? ? </LinearLayout>
? ? <LinearLayout
? ? ? ? android:layout_width="match_parent"
? ? ? ? android:layout_height="wrap_content">
? ? ? ? <TextView
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:layout_marginLeft="5dp"
? ? ? ? ? ? android:layout_marginTop="6dp"
? ? ? ? ? ? android:textSize="15dp"
? ? ? ? ? ? android:text="所在地"/>
? ? ? ? <Spinner
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:layout_marginTop="6dp"
? ? ? ? ? ? android:layout_marginLeft="10dp"
? ? ? ? ? ? android:entries="@array/citys">

? ? ? ? </Spinner>
? ? </LinearLayout>
? ? <Button
? ? ? ? android:layout_width="match_parent"
? ? ? ? android:layout_height="wrap_content"
? ? ? ? android:text="注冊(cè)"
? ? ? ? android:textColor="@color/colorPrimaryDark"/>

</LinearLayout>

strings.xml

<resources>
? ? <string name="app_name">Register</string>
? ? <string-array name="citys">
? ? ? ? <item>贛州</item>
? ? ? ? <item>上海</item>
? ? ? ? <item>廣州</item>
? ? ? ? <item>深圳</item>
? ? ? ? <item>北京</item>
? ? ? ? <item>湖南</item>
? ? ? ? <item>湖北</item>
? ? ? ? <item>南寧</item>
? ? ? ? <item>廈門</item>
? ? </string-array>
</resources>

Main.java

package com.example.hsy.register;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

? ? @Override
? ? protected void onCreate(Bundle savedInstanceState) {
? ? ? ? super.onCreate(savedInstanceState);
? ? ? ? setContentView(R.layout.register);
? ? }
}

效果圖

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Android實(shí)現(xiàn)畫畫板案例

    Android實(shí)現(xiàn)畫畫板案例

    這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)畫畫板案例,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-01-01
  • Kotlin HttpURLConnection與服務(wù)器交互實(shí)現(xiàn)方法詳解

    Kotlin HttpURLConnection與服務(wù)器交互實(shí)現(xiàn)方法詳解

    簡(jiǎn)單來說,HttpURLConnection 是發(fā)起HTTP請(qǐng)求的基礎(chǔ)類庫(kù),提供了HTTP請(qǐng)求的基本功能,不過封裝的比較少,在使用時(shí)很多內(nèi)容都需要自己設(shè)置,也需要自己處理請(qǐng)求流和響應(yīng)流
    2022-09-09
  • 利用Kotlin如何實(shí)現(xiàn)Android開發(fā)中的Parcelable詳解

    利用Kotlin如何實(shí)現(xiàn)Android開發(fā)中的Parcelable詳解

    這篇文章主要給大家介紹了關(guān)于利用Kotlin如何實(shí)現(xiàn)Android開發(fā)中的Parcelable的相關(guān)資料,并且給大家介紹了關(guān)于Kotlin使用parcelable出現(xiàn):BadParcelableException: Parcelable protocol requires a Parcelable.Creator...問題的解決方法,需要的朋友可以參考下。
    2017-12-12
  • android里TextView加下劃線的幾種方法總結(jié)

    android里TextView加下劃線的幾種方法總結(jié)

    下面小編就為大家?guī)硪黄猘ndroid里TextView加下劃線的幾種方法總結(jié)。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2016-10-10
  • Android應(yīng)用程序簽名步驟及相關(guān)知識(shí)介紹

    Android應(yīng)用程序簽名步驟及相關(guān)知識(shí)介紹

    本文主要介紹Android應(yīng)用程序簽名相關(guān)的理論知識(shí),包括:什么是簽名、為什么要給應(yīng)用程序簽名、如何給應(yīng)用程序簽名等,感興趣的朋友可以參考下哈
    2013-04-04
  • Android中判斷是否聯(lián)網(wǎng)實(shí)現(xiàn)代碼

    Android中判斷是否聯(lián)網(wǎng)實(shí)現(xiàn)代碼

    這篇文章主要介紹了Android中判斷是否聯(lián)網(wǎng)實(shí)現(xiàn)代碼,本文直接給出實(shí)現(xiàn)代碼,需要的朋友可以參考下
    2015-06-06
  • android仿京東商品屬性篩選功能

    android仿京東商品屬性篩選功能

    這篇文章主要為大家詳細(xì)介紹了android仿京東商品屬性篩選功能,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-12-12
  • android倒計(jì)時(shí)控件示例

    android倒計(jì)時(shí)控件示例

    這篇文章主要為大家詳細(xì)介紹了android倒計(jì)時(shí)控件示例,感興趣的小伙伴們可以參考一下
    2016-03-03
  • Android編程重寫ViewGroup實(shí)現(xiàn)卡片布局的方法

    Android編程重寫ViewGroup實(shí)現(xiàn)卡片布局的方法

    這篇文章主要介紹了Android編程重寫ViewGroup實(shí)現(xiàn)卡片布局的方法,實(shí)例分析新建FlowLayout繼承ViewGroup類及設(shè)置布局文件實(shí)現(xiàn)卡片布局效果的相關(guān)技巧,需要的朋友可以參考下
    2016-02-02
  • Android中的JSON詳細(xì)總結(jié)

    Android中的JSON詳細(xì)總結(jié)

    一種輕量級(jí)的數(shù)據(jù)交換格式,具有良好的可讀和便于快速編寫的特性。業(yè)內(nèi)主流技術(shù)為其提供了完整的解決方案(有點(diǎn)類似于正則表達(dá)式,獲得了當(dāng)今大部分語(yǔ)言的支持),從而可以在不同平臺(tái)間進(jìn)行數(shù)據(jù)交換
    2013-01-01

最新評(píng)論

运城市| 洪泽县| 宁晋县| 犍为县| 忻城县| 黎城县| 从江县| 武定县| 遂昌县| 刚察县| 尉氏县| 大石桥市| 紫云| 菏泽市| 友谊县| 汉源县| 绥化市| 蒙山县| 固镇县| 萍乡市| 平南县| 炉霍县| 江孜县| 宁蒗| 界首市| 绥宁县| 明光市| 信丰县| 南平市| 兴国县| 兴山县| 嘉峪关市| 庆安县| 东乌珠穆沁旗| 集安市| 彰武县| 大理市| 巴中市| 沾化县| 德清县| 高淳县|