国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Android實(shí)現(xiàn)簡(jiǎn)單的登陸頁(yè)面(最新版2023詳細(xì)圖文教程

這篇具有很好參考價(jià)值的文章主要介紹了Android實(shí)現(xiàn)簡(jiǎn)單的登陸頁(yè)面(最新版2023詳細(xì)圖文教程。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

?

目錄

?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-589228.html

1.打開(kāi)android studio軟件

?2.新建empty activity

3.看個(gè)人配置填(finish)

?4.左側(cè)找到res->layout(頁(yè)面布局)

?5.先設(shè)置頁(yè)面布局,這里采用線性布局

?7.設(shè)置頭文本??? --文本展示標(biāo)簽

?8.用戶名與密碼--可編輯文本標(biāo)簽

9.提交按鈕

10.整體代碼


1.打開(kāi)android studio軟件

android登錄頁(yè)面代碼,android,android,java,android studio

?2.新建empty activity

android登錄頁(yè)面代碼,android,android,java,android studio

3.看個(gè)人配置填(finish)

android登錄頁(yè)面代碼,android,android,java,android studio

?4.左側(cè)找到res->layout(頁(yè)面布局)

?

android登錄頁(yè)面代碼,android,android,java,android studioandroid登錄頁(yè)面代碼,android,android,java,android studio

?5.先設(shè)置頁(yè)面布局,這里采用線性布局

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
</LinearLayout>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="#e5e4e2">
</LinearLayout>

android:layout_width=""的使用方法

android:layout_width是控件在水平方向上的布局參數(shù),其屬性值包括match_parentwrap_content具體的數(shù)值。其中,match_parent表示控件的寬度與其父容器的寬度相同,充滿整個(gè)父容器;而wrap_content表示控件的寬度會(huì)根據(jù)其內(nèi)部?jī)?nèi)容的寬度自適應(yīng)調(diào)整,即控件的寬度由其內(nèi)部的內(nèi)容而定。兩者的區(qū)別在于,match_parent會(huì)讓控件的寬度填充滿父容器,而wrap_content則會(huì)讓控件的寬度自適應(yīng)其內(nèi)部的內(nèi)容寬度。同時(shí),也可以通過(guò)設(shè)置具體的數(shù)值來(lái)控制控件的寬度,如android:layout_width="100dp"表示控件的寬度為100dp

android:orientation=""的使用方法

android:orientation是指控件中子視圖排列的方向。具體來(lái)說(shuō),它可以用于控制線性布局(LinearLayout)中子視圖的排列方式,有兩個(gè)可選值:horizontalvertical。

  • android:orientation="horizontal"表示子視圖水平排列,即從左到右依次排列。
  • android:orientation="vertical"表示子視圖垂直排列,即從上到下依次排列

?android:background=""的使用方法

?設(shè)置背景,可填入需要顏色的16進(jìn)制

?7.設(shè)置頭文本??? <TextView></TextView>--文本展示標(biāo)簽

android登錄頁(yè)面代碼,android,android,java,android studio

    <TextView
        
        android:layout_width="match_parent"
        android:layout_height="76dp"
        android:text="              MILK商城登陸"
        android:textColor="#ffd700"
        android:textSize="30sp"
        android:textStyle="bold"
        android:layout_marginTop="150dp"
        ></TextView>

??????? android:textColor="" --文字顏色
??????? android:textSize=""--文字大小
??????? android:textStyle=""--文字樣式 bold粗體字
??????? android:layout_marginTop="150dp" --與上部距離隔開(kāi)150dp長(zhǎng)度

?8.用戶名與密碼<EditText></EditText>--可編輯文本標(biāo)簽

android登錄頁(yè)面代碼,android,android,java,android studio


    <EditText
        android:id="@+id/user"
        android:layout_width="411dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:hint="用戶名"
        android:layout_marginTop="50dp"
        android:textAlignment="center"
        >

    </EditText>

    <EditText
        android:id="@+id/password"
        android:layout_width="411dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:hint="密碼"
        android:textAlignment="center"
        >

    </EditText>

?android:hint=""--提示輸入文本

?android:textAlignment="center"--文字排列 居中

android:id="@+id/"--設(shè)置id

9.提交按鈕

android登錄頁(yè)面代碼,android,android,java,android studio

?

 <Button
        android:id="@+id/button3"
        android:layout_width="278dp"
        android:layout_height="59dp"
        android:layout_gravity="center"
        android:text="登陸"
        android:layout_marginTop="20dp"
        />

?android:layout_gravity="center" --設(shè)置標(biāo)簽位置
?android:text="登陸" --標(biāo)簽內(nèi)文本

10.整體代碼

android登錄頁(yè)面代碼,android,android,java,android studio

?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="#e5e4e2">

    <TextView
        
        android:layout_width="match_parent"
        android:layout_height="76dp"
        android:text="              MILK商城登陸"
        android:textColor="#ffd700"
        android:textSize="30sp"
        android:textStyle="bold"
        android:layout_marginTop="150dp"
        ></TextView>

    <EditText
        android:id="@+id/user"
        android:layout_width="411dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:hint="用戶名"
        android:layout_marginTop="50dp"
        android:textAlignment="center"
        >

    </EditText>

    <EditText
        android:id="@+id/password"
        android:layout_width="411dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:hint="密碼"
        android:textAlignment="center"
        >

    </EditText>

    <Button
        android:id="@+id/button3"
        android:layout_width="278dp"
        android:layout_height="59dp"
        android:layout_gravity="center"
        android:text="登陸"
        android:layout_marginTop="20dp"
        />


</LinearLayout>

到了這里,關(guān)于Android實(shí)現(xiàn)簡(jiǎn)單的登陸頁(yè)面(最新版2023詳細(xì)圖文教程的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Flutter入門教程(一),2023最新版包含安裝,初始化!簡(jiǎn)單易懂!

    Flutter入門教程(一),2023最新版包含安裝,初始化!簡(jiǎn)單易懂!

    首先,在一切的開(kāi)始之前我們來(lái)介紹一下什么是Flutter,F(xiàn)lutter 是一個(gè)由 Google 開(kāi)發(fā)的開(kāi)源移動(dòng)應(yīng)用程序開(kāi)發(fā)框架,可以讓開(kāi)發(fā)者使用單一代碼庫(kù)構(gòu)建高質(zhì)量的、高性能的 Android 和 iOS 應(yīng)用程序。Flutter 的主要優(yōu)勢(shì)之一是其快速的開(kāi)發(fā)周期,因?yàn)樗褂昧藷嶂剌d技術(shù),這意味著開(kāi)

    2024年02月16日
    瀏覽(17)
  • 【Android】最新版Android13使用Notification,Notification的基本使用和進(jìn)階使用

    【Android】最新版Android13使用Notification,Notification的基本使用和進(jìn)階使用

    1.1 注冊(cè)一個(gè)渠道 在Android13,版本通知的使用發(fā)生了新的變化。 1.1.1 NotificationManager原生類 首先我們需要?jiǎng)?chuàng)建一個(gè) NotificationManager 用于管理通知。 NotificationManager 僅支持在 API 等級(jí) 11(Android 3.0)及以上的設(shè)備上使用 ,因此在較舊的 Android 版本上無(wú)法使用較新的通知功能。 `

    2024年01月17日
    瀏覽(23)
  • 2023最新版Android逆向教程——第1天:Android Studio的安裝與配置

    2023最新版Android逆向教程——第1天:Android Studio的安裝與配置

    通常情況下,為了提高開(kāi)發(fā)效率,需要使用相應(yīng)的開(kāi)發(fā)工具。在 Android 發(fā)布初期,推薦使用的開(kāi)發(fā)工具是 Eclipse,隨著 2015 年 Android Studio 正式版推出,標(biāo)志著 Google 公司推薦的 Android 開(kāi)發(fā)工具已從 Eclipse 更改為 Android Studio。而且在 Android 的官方網(wǎng)站中,也提供了集成 Android 開(kāi)

    2024年02月07日
    瀏覽(30)
  • 小白配置java環(huán)境與Android Studio目前最新版下載安裝

    小白配置java環(huán)境與Android Studio目前最新版下載安裝

    Android Studio 是用于開(kāi)發(fā) Android 應(yīng)用的官方集成開(kāi)發(fā)環(huán)境 (IDE)。Android Studio 基于?IntelliJ IDEA?強(qiáng)大的代碼編輯器和開(kāi)發(fā)者工具,還提供更多可提高 Android 應(yīng)用構(gòu)建效率的功能,例如: 基于 Gradle 的靈活構(gòu)建系統(tǒng) 快速且功能豐富的模擬器 統(tǒng)一的環(huán)境(供您開(kāi)發(fā)適用于所有 Android

    2024年02月04日
    瀏覽(22)
  • Android Studio最新版:TextView字體加粗、水平居中和垂直居中

    Android Studio最新版:TextView字體加粗、水平居中和垂直居中 在Android應(yīng)用程序的開(kāi)發(fā)過(guò)程中,我們經(jīng)常需要對(duì)界面上的文本進(jìn)行樣式設(shè)置,其中包括字體加粗以及水平居中和垂直居中顯示。本文將介紹如何使用最新版的Android Studio實(shí)現(xiàn)這些效果,并提供相應(yīng)的源代碼作為參考。

    2024年01月23日
    瀏覽(92)
  • Stable Diffusion系列(一):古早顯卡上最新版 WebUI 安裝及簡(jiǎn)單操作

    Stable Diffusion系列(一):古早顯卡上最新版 WebUI 安裝及簡(jiǎn)單操作

    環(huán)境安裝 https://blog.csdn.net/qq_44525568/article/details/132338630?spm=1001.2014.3001.5506 https://zhuanlan.zhihu.com/p/617997179 https://www.tjsky.net/tutorial/488 插件安裝與使用: https://tianfeng.space/1557.html https://tianfeng.space/1682.html 模型使用 https://zhuanlan.zhihu.com/p/631089077 Controlnet使用 https://www.uisdc.com/control

    2024年02月08日
    瀏覽(19)
  • uniapp 移動(dòng)端app判斷用戶app版本是否是最新版(Android)

    1.在uniapp項(xiàng)目中的App.vue文件下 2. 具體實(shí)現(xiàn)代碼 ios的話自行給提示 去應(yīng)用商店下載

    2024年01月20日
    瀏覽(20)
  • 微信小程序新版隱私協(xié)議彈窗實(shí)現(xiàn)最新版

    微信小程序新版隱私協(xié)議彈窗實(shí)現(xiàn)最新版

    2023.08.22更新:【原文連接】 以下指南中涉及的 getPrivacySetting、onNeedPrivacyAuthorization、requirePrivacyAuthorize 等接口目前可以正常接入調(diào)試。調(diào)試說(shuō)明: 在 2023年9月15號(hào)之前,在 app.json 中配置 __usePrivacyCheck__: true 后,會(huì)啟用隱私相關(guān)功能,如果不配置或者配置為 false 則不會(huì)啟用。

    2024年02月10日
    瀏覽(98)
  • VBA實(shí)現(xiàn)毫秒級(jí)延時(shí)(2022最新版)

    VBA實(shí)現(xiàn)毫秒級(jí)延時(shí)(2022最新版)

    要不是年會(huì)需要使用PPT來(lái)做抽獎(jiǎng),我才不會(huì)用這么難用的VBA。 VBA要實(shí)現(xiàn)延時(shí)功能,大多數(shù)教程都會(huì)拿2016年ExcelHome里的上古帖子不厭其煩地復(fù)制粘貼,然后你復(fù)制下來(lái)發(fā)現(xiàn)根本無(wú)法運(yùn)行。 現(xiàn)在我從頭給你講,到底怎樣在VBA中實(shí)現(xiàn)毫秒級(jí)延時(shí)功能。 思路很清晰,分三步走: 1

    2024年02月07日
    瀏覽(160)
  • 2023最新版Android studio安裝入門教程(非常詳細(xì))從零基礎(chǔ)入門到精通,看完這一篇就夠了

    2023最新版Android studio安裝入門教程(非常詳細(xì))從零基礎(chǔ)入門到精通,看完這一篇就夠了

    目錄 JDK安裝與配置 一、下載JDK 二、JDK安裝 三、JDK的環(huán)境配置 四、JDK的配置驗(yàn)證 Android studio安裝 Android studio連接手機(jī)真機(jī)調(diào)試(以華為鴻蒙為例) 一、新建一個(gè)android項(xiàng)目 二、進(jìn)入項(xiàng)目面板 三、配置Android Studio 四、安裝手機(jī)驅(qū)動(dòng)程序 五、連接手機(jī) 六、運(yùn)行程序 七、查看手

    2024年02月10日
    瀏覽(27)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包