Android 常用且比较好看的EditText(二)—— TextInputEditText

TextInputLayout与TextInputEditText详解 导读:Android 从5.0版本开始,新增了Android Materia Design库,让开发者高效的实现炫酷的UI效果本篇文章将介绍Materia Design库的TextInputLayout与TextInputEditText组件TextInputLayout TextInputLayout用于辅助EditText,当用户输入文本时,在EditText上方显示浮动标签,这个标签的内容就是 阅读详情

Android EditText

之前讲了一个带动画的EditText
这一篇来讲一下
对于我个人也比较常用的一个EditText —— Material Design 的 TextInputEditText
网上也有很多文章关于这个TextInputEditText
很多属性也都归纳过
这里我就简单讲述一下 我使用的
仅为个人自己所学习和使用的

首先 TextInputEditText 要和TextInputLayout 搭配使用
TextInputLayout 就等同于一个线性布局,TextInputEditText的限制属性也可以在TextInputLayout 中描述声明

样例

简单放一下样例
在这里插入图片描述
在这里插入图片描述
样例中,字数超过限制后会相应的报错,如果用于密码还可以设置显示和隐藏密码
之前也写过文章关于这个隐藏密码的问题
Android TextInputEditText初始隐藏密码

图一xml

下面分别给出两张图的两段代码

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/cloud"
    tools:context=".ui.LoginActivity">

    <androidx.appcompat.widget.LinearLayoutCompat
        android:layout_width="320dp"
        android:layout_height="320dp"
        android:layout_centerInParent="true"
        android:background="@drawable/shape_mine_top1"
        android:elevation="5dp"
        android:orientation="vertical"
        android:paddingTop="10dp">

        <com.google.android.material.textfield.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="10dp">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/account"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:drawableStart="@drawable/identification"
                android:drawableLeft="@drawable/identification"
                android:hint="请输入账号"
                android:imeOptions="actionNext"
                android:inputType="text" />
        </com.google.android.material.textfield.TextInputLayout>

        <com.google.android.material.textfield.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="10dp"
            app:hintAnimationEnabled="true"
            app:hintEnabled="true"
            app:passwordToggleEnabled="true"
            app:passwordToggleTint="@color/toggle">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/password"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:drawableStart="@drawable/password"
                android:drawableLeft="@drawable/password"
                android:hint="请输入密码"
                android:imeOptions="actionDone"
                android:inputType="number" />
        </com.google.android.material.textfield.TextInputLayout>

        <com.google.android.material.button.MaterialButton
            android:id="@+id/submit"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginTop="25dp"
            android:backgroundTint="#FFFFFF"
            android:paddingLeft="25dp"
            android:paddingRight="25dp"
            android:text="确定"
            android:textColor="#CC9933"
            app:cornerRadius="15sp"
            app:icon="@drawable/right"
            app:iconSize="20dp"
            app:iconTint="#CC9933"
            app:strokeColor="#7FFFD4"
            app:strokeWidth="2dp" />


        <com.google.android.material.textview.MaterialTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="注册账号"
            android:textColor="#808080"
            android:textSize="11sp"/>


    </androidx.appcompat.widget.LinearLayoutCompat>

</RelativeLayout>

图二xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".button_list.TextInputEdit">

    <com.google.android.material.textfield.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dp"
        android:layout_marginTop="10dp"
        android:layout_marginRight="5dp"
        android:layout_marginBottom="10dp"
        android:background="@drawable/text_edit"
        app:counterEnabled="true"
        app:counterMaxLength="8"
        app:counterOverflowTextAppearance="@style/counterOverFlow"
        app:counterTextAppearance="@style/CounterStyle"
        app:hintAnimationEnabled="true"
        app:hintEnabled="true">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:drawableLeft="@drawable/man"
            android:hint="请输入相应内容"
            android:imeOptions="actionNext"
            android:inputType="text"
            android:paddingLeft="10dp"
            android:textColorHint="#fff" />
    </com.google.android.material.textfield.TextInputLayout>


    <com.google.android.material.textfield.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dp"
        android:layout_marginTop="10dp"
        android:layout_marginRight="5dp"
        android:layout_marginBottom="10dp"
        android:hint="请输入相应内容"
        android:background="@drawable/second_text_edit"
        app:counterEnabled="true"
        app:counterMaxLength="6"
        app:counterOverflowTextAppearance="@style/counterOverFlow"
        app:hintAnimationEnabled="true"
        app:hintEnabled="true"
        app:passwordToggleEnabled="true"
        app:passwordToggleTint="@color/toggle">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:imeOptions="actionNext"
            android:inputType="number"/>


    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/textInputLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="10dp"
        android:layout_marginRight="10dp"
        android:hint="请输入相应内容"
        app:counterEnabled="true"
        app:counterMaxLength="6"
        app:hintAnimationEnabled="true"
        app:hintEnabled="true">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/textInputEditText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:imeOptions="actionDone"
            android:inputType="number"/>

    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/textInputLayout_second"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="10dp"
        android:layout_marginRight="10dp"
        android:hint="请输入相应内容"
        app:counterEnabled="true"
        app:counterMaxLength="6"
        app:hintAnimationEnabled="true"
        app:hintEnabled="true">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/textInputEditText_second"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:imeOptions="actionDone"
            android:inputType="number"/>

    </com.google.android.material.textfield.TextInputLayout>



</LinearLayout>

这里仅仅提及我上图所使用的属性
且属性说明比较口语化

涉及字体样式的,图中使用colors和style的可以定义颜色

属性属性说明
android:drawableLeft在输入框左边添加图片
app:hintAnimationEnabledhint的动画是否显示,默认显示,默认值为true
app:hintEnabledhint是否使用,默认使用,默认值为true
app:passwordToggleEnabled是否使用密码隐藏和显示,需要设置EditText inputType
app:passwordToggleTint密码显示和隐藏图片颜色
app:counterEnabled是否使用计数器
app:counterMaxLength计数器的最大值,需要使用计数器
app:counterOverflowTextAppearance超过计数器最大值时字体样式
app:counterTextAppearance计数器的字体的样式

可以看到图二中,第三第四个是有错误的提示的,这个是自定义的样式
接下来通过活动来编写

错误提示样式一

activity

	private TextInputLayout textInputLayout;
	private TextInputEditText textInputEditText;        //EditText错误信息

	textInputLayout = (TextInputLayout) findViewById(R.id.textInputLayout);
	textInputEditText = (TextInputEditText) findViewById(R.id.textInputEditText);   //EditText错误信息
 
	makerEditText();

    //自定义错误信息
    public void makerEditText() {
        textInputEditText.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {

            }

            @Override
            public void afterTextChanged(Editable s) {
                if (textInputEditText.getText().length() > textInputLayout.getCounterMaxLength()) {
                    textInputEditText.setError("已经超过限定字数了!! 需要重新输入");
                }
            }
        });
    }

这一个自定义的错误信息是设置在EditText(TextInputEditText)的
通过监听TextInputEditText,判断输入的是否大于规定的计数器的最大值,超过则显示错误信息,setError

错误提示样式二

activity

	private TextInputLayout newTextInputLayout;
    private TextInputEditText newTextInputEditText;    //Layout错误信息

	newTextInputLayout = (TextInputLayout) findViewById(R.id.textInputLayout_second);
    newTextInputEditText = (TextInputEditText) findViewById(R.id.textInputEditText_second);  //Layout错误信息	
    
   	makerLayout();

    private void makerLayout() {
        newTextInputEditText.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {

            }

            @Override
            public void afterTextChanged(Editable s) {
                if (newTextInputEditText.getText().length() > newTextInputLayout.getCounterMaxLength()) {
                    newTextInputLayout.setError("超过规定字数!请更改内容");
                } else {
                    newTextInputLayout.setErrorEnabled(false);
                }
            }
        });
    }

这个错误信息是设置在TextInputLayout的,所以图中的第三个输入框错误信息在TextInputEditText上,第四个在TextInputLayout上
也是通过监听TextInputEditText,判断是否字数超过计数器最大值


错误信息样式关键点

ps:细心的会发现都是显示错误信息,而样式二的代码有else的情况,这是为什么?

原因是:因为错误信息设置在TextInputLayout上,如果不写else的内容,
当第一次的输入超过计数器最大值而显示错误信息后,此时退格删除输入的信息使输入的长度小于计数器最大值,但是却会发现错误信息不会消失

所以需要设置一个else,当退格删除后,小于计数器最大值,保证错误信息消失、不显示 newTextInputLayout.setErrorEnabled(false);


总结

这个就是自己经常使用的EditText的第二部分,
Material Design的内容还是比较好看的
自己也比较喜欢用这个,平时出现的问题也努力解决以达到想要的效果

以后还会继续发表一些自己比较喜欢使用的控件

学习Android的路还很长,大家共同努力❤

Android开发:解决TextInputEditText的提示文本问题 在使用和时,如果需要动态设置文本并隐藏提示文本,可以通过设置为false来实现。记得在设置文本后立即调用这个方法,以确保提示文本不会出现在输入框中。这个技巧在开发过程中非常实用,可以帮助开发者更好地管理用户界面的显示效果。 阅读详情

相关推荐

Android开发:EditText文本转换详解

在Android开发中,处理EditText的文本时,经常会遇到类型转换的问题。通过理解EditText的text属性返回的是Editable类型,并利用方法进行类型转换,可以确保代码逻辑的严谨性和功能的实现。这个实例不仅展示了如何处理用户输入,还强调了在编程中注意数据类型转换的重要性。

m0_74337424的博客 143

TextInputEditText用法

前言: Material Design推出了一种优秀的文本输入框形式——当用户点击空内容的文本输入框时,原本位于输入框内的提示语会经由一个动画浮动至输入框上方,文本颜色同时变成强调色,明确显示此时该组件获得焦点 为了让开发者更加方便地实现这种效果Google推出了TextInputLayout组件,里面放置一个EditText或者TextInputEditText,可以轻松实现

yhy123456q的博客 7726

Material Design输入组件实践:TextInputLayout与TextInputEditText

本文还有配套的精品资源,点击获取 简介:介绍Android中 TextInputLayout 和 TextInputEditText 组件,用于创建具有高级用户交互特性的表单。详细说明了组件的样式功能,包括浮动标签、错误提示、助手文本、前后缀文本及密码可见性切换。通过实例代码展示了如何实现这些功能,并强调了这些组件对于增强表单体验的重要性。 ...

weixin_30600615的博客 1669

Android 常用且比较好看的EditText(一)——带动画的EditText搜索框

Android EditText组件:带过渡动画的常用EditText组件

https://github.com/W4ited 4778

从零到一:DAMASK与ABAQUS联合仿真的环境配置艺术

本文详细介绍了在Ubuntu 16.04系统中配置DAMASK与ABAQUS2017联合仿真环境的完整流程,涵盖系统基础环境搭建、Python科学计算环境构建、DAMASK核心安装与配置,以及ABAQUS集成与联合调试。通过实战案例和高级调试技巧,帮助用户快速掌握有限元分析中的晶体塑性模拟技术。

weixin_29253711的博客 871

详细推导波特图增益和相位曲线

文章来源:https://mp.weixin.qq.com/s/UCy9mRRok5Hc9qHq3qde5g 今天这篇文章想把近段时间关于波特图方面学习的内容整理一下。波特图将会是梳理闭环控制这个系列的开始。目前的计划是,以无源器件为基础,然后结合运放,再过渡到开关电源的环路控制方面。如果对这方面感兴趣的朋友,可以持续一起学习起来,目标就是掌握开关电源的闭环控制。 1. 什么是波特图? 波特图最常见的应用是在线性非时变的系统中,用于对传递函数的增益和相位进行分析,从而判断出系统随频率的响应是否稳定。因此,波

ltqdxl的博客 2万+

TextInputEditText 替换EditText解决警告Missing autofillHints attribute以及实现错误提示

在使用EditText时,会出现Missing autofillHints attribute 解决方式1:使用ignore或者加入android:autofillHints 但是如果你api低于26,又会提示only used in API level 26 and higher 就又要使用ignore 解决方式2:使用TextInputEditText替代,本文主要讲解TextInputEdi...

weixin_46444429的博客 1万+

C语言实现惯性导航初始对准全部核心代码

惯性导航初始对准包括间接粗对准和卡尔曼滤波精对准,其中。为基于卡尔曼滤波的精对准,其中。

十八与她的博客 2291

android widget edittext,Android原生控件之--TextInputLayout、TextInputEditText

TextInputLayout是22.2.0新添加的控件, 要和EditText(或EditText的子类)结合使用,并且只能包含一个EditText(或EditText的子类)。TextInputLayout继承关系如下:java.lang.Object↳ android.view.View↳ android.view.ViewGroup↳ android.widget.Lin...

weixin_34673225的博客 430

第5.2章 【自动驾驶行业融合定位核心】:手把手详解ESKF(误差卡尔曼滤波)理论公式及代码

自动驾驶定位中的ESKF(误差卡尔曼滤波)技术是解决IMU累积误差的关键,通过分离名义状态与误差状态实现高精度定位。其核心步骤包括:1)名义状态递推(位置/速度/姿态的基础物理计算);2)误差传播建模(雅可比矩阵F量化误差影响);3)协方差更新(评估定位不确定性)。ESKF在GNSS信号丢失(如隧道场景)、无卫星定位(地下车库)等场景发挥重要作用,通过融合多传感器数据维持定位精度。工程实现需解决零偏校准、协方差投影等关键问题,噪声参数需通过数据标定而非随意设置。掌握ESKF原理与实现是自动驾驶定位工程师的核

行知SLAM 723

Python 爬虫实战:爬取哔哩哔哩知识区,抓取高赞课程信息

哔哩哔哩(Bilibili)是一个广受欢迎的综合性视频社区,其中的知识区汇聚了大量优质的教育、科普、技术等课程内容。本文将指导读者如何使用 Python 爬虫技术从哔哩哔哩知识区抓取高赞课程信息,并进行数据分析。本文深入探究了利用 Python 爬虫技术从哔哩哔哩知识区抓取高赞课程信息的全流程。从前期的环境搭建、模拟登录,到核心的课程数据抓取、存储,再到后续的数据分析与可视化,都详细展开讲解并提供代码支持。通过此方法所获取的数据,能够助力创作者优化内容、用户发现优质课程、平台洞察用户需求。

u014481728的博客 1146

Android 控件 - TextInputLayout 与 TextInputEditText、AppCompatEditText

Android 控件 - TextInputLayout 与 TextInputEditText、AppCompatEditText

weixin_52173250的博客 1413

智能车图像处理2-入门级分析1 ---基础扫线

PS :入门级文章适合新手,如果已经有基础可以去看进阶篇文章。

taiyuezyh的博客 7787

TextInputEditText设置密码更新图标的方法

首先要导入应用包implementation 'com.android.support:design:26.1.0此时我们需要给我们的EditText设置我们需要的点击显示图标R.drawable.register_password_selector&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;selector xmlns:android="ht...

qq_32290351的博客 1386

【数据集3】高分辨率统计降尺度日值数据集NEX-GDDP的介绍与下载方法

对NEX-GDDP数据集进行介绍和下载说明

WW、forever的博客 2402

Qt —— 在Win11下“Qt for Android“开发环境,通过USB在真机(华为Meta60 PRO)上调试运行,并打包APK并在真实手机运行

Qt —— 在Win11下“Qt for Android“开发环境,打包APK并在真实手机运行

322

Android开发:TextInputEditText与EditText的差异与进阶应用

在Android UI开发中,文本输入框是构建表单和交互界面的基础组件。Material Design推出的TextInputEditText作为EditText的增强版,通过集成TextInputLayout实现了浮动标签、错误提示等现代化功能。从技术原理看,这种组合控件利用父子视图协作机制,将样式控制与功能逻辑分离,既保持了Material Design规范的一致性,又提供了字符计数、密码可见性切换等实用功能。对于需要深度定制的场景,开发者可以通过继承TextInputEditText类重写绘制逻辑,或

weixin_42647395的博客 286

贝叶斯统计 [韦来生编]

贝叶斯(Bayes)统计是近几十年来迅速发展起来的数理统计的一个重要分支。贝叶斯方法与经典统计方法的主要不同之处是进行统计推断时除了利用样本信息外,还要利用参数的先验信息,因此可以提高统计推断或统计决策的效果。它在经济、金融、生物、医学、自然科学和社会科学等许多领域具有广泛的应用。贝叶斯方法的研究已渗透到了统计学的几乎所有领域。作者在给中国科学技术大学概率论与数理统计专业本科生开设的“数理统计”课程中有一章专门讲授“贝叶斯方法和统计决策理论”,近十年来也给中国科学技术大学概率统计专业研究生开设过几次“贝叶斯分析”课。本书是在对过去讲稿的内容作了适当的增减和调整的基础上完成的。  本书共分六章。第1章是绪论,介绍了贝叶斯统计的若干基本概念,同时对必要的数理统计的基础知识有重点地作了回顾。第二章介绍了确定先验分布的若干可供选择的方法。第三章介绍了几类常见统计模型参数的后验分布的主要结果和计算方法。第四章和第五章分别介绍了“贝叶斯统计推断”和“贝叶斯统计决策”的内容。第六章介绍了贝叶斯统计计算的若干方法,包括蒙特卡洛方法和马尔可夫链蒙特卡洛(MCMC)方法以及相关统计软件的简介。本书的每一章附右大量的例题和习题,书末附有常用的几个表格和部分习题解答供读者查用。  大约可在54学时内讲授本书的第1章至第六章的主要内容,教师可根据学时需要选讲本书第1章至第六章的部分内容。书中标“*”号的章节可略去不讲,留给读者作为阅读材料。第六章例题中的R代码和部分例题的数据文件等可从作者个人主页下载。  作者在编写本书的过程中参考了J.O.Berger教授的《统计决策论及贝叶斯分析》和茆诗松教授编写的《贝叶斯统计》等书中的一些内容,以及《贝叶斯分析》一书中由张伟平博士编写的有关贝叶斯统计计算的一些内容。在此表示衷心感谢。  本书编写准备过程中,中国科学技术大学统计与金融系的几个研究生帮助完成了本书部分中文的录入和排版,作者对他们的辛勤工作表示真诚的感谢。高等教育出版社为本书的出版给予了大力支持。在此一并致谢。

使用textinputlayout内置的textinputEditText代替普通edittext功能更加强大

这是android studio添加textInputLayout里面的textInputEditText。但是如果不需要复制黏贴,那么就用这个普通的EditText,对于较多文本内容,需要复制的,就用上面那个。这个EditText是EditText的升级版本,支持复制黏贴。比这个生成的EditText更加强大。

46

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Android Design Support Library使用详解——TextInputLayout与TextInputEditText

TextInputLayout在谷歌的Material Design中,文本输入是这样表现的:当用户点击输入框想要输入文字时,如果输入框是空的,那么它的提示文字(hint)就会变小并且同时移动到输入框的上方;如果文字不为空,则上方一直浮着这个提示文字(见https://material.google.com/components/text-fields.html#text-fields-input

一个码农的博客 6585

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Android之增强文本框(TextInputEditText)

效果图: xml代码: activity_text_input_layout.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.andr...

Wdani的博客 3660

安卓判断控件是否已经获得焦点_Android原生控件之--TextInputLayout、TextInputEditText...

TextInputLayout是22.2.0新添加的控件, 要和EditText(或EditText的子类)结合使用,并且只能包含一个EditText(或EditText的子类)。TextInputLayout继承关系如下:java.lang.Object ↳ android.view.View ↳ android.view.ViewGroup ...

weixin_39929153的博客 519

android 8.0 edittext,关注TextInputEditText的Android 8.0 Oreo崩溃

在将我们的一些设备更新到Android 8.0之后,在关注TextInputLayout内的TextInputEditText字段时,应用程序崩溃了这个例外:Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'voidandroid.view.View.getBoundsOnScree...

weixin_39692623的博客 196

android控件之EditText

EditText继承关系:View-->TextView-->EditText EditText的属性很多,这里介绍几个: android:hint="请输入数字!"//设置显示在控件上的提示信息 android:numeric="integer"//设置只能输入整数,如果

lgl125的专栏 1016

TextInputEditText 中文翻译

TextInputEditText 中文翻译

pingfangx的博客 1688

Android Design Support Library(一):FloatingActionButton、TextInputLayout、TextInputEditText简单用法

Android Design Support Library(一):FloatingActionButton、TextInputLayout、TextInputEditText简单用法

朱磊的博客 1万+

android design包控件,Android Design包之TextInputLayout和TextInputEditText的组合使用【原创】...

在Android的日常开发中,EditText是个不可或缺的控件之一,作为输入框,用法也没什么太多值得可说的,拿一个简单的登录界面为例,平时差不多是这样的布局: 一般来说是这样,EditText里面的hint属性作为提示语,但是一旦输入的时候,提示语就会消失,另外对于不合法的输入我们一般来说会采用Toast的方式来进行提示。那么接下来看看采用design包中的TextInputLayout和Te...

weixin_32139147的博客 463
上一篇: Android 常用且比较好看的EditText(一)——带动画的EditText搜索框
下一篇: Android 方法封装至类里的时间选择器
iㅤ
博客等级 码龄6年 106粉丝 13原创
评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

iㅤ

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值