public void afterTextChanged(Editable s) {
if (textInputLayout.getEditText().getText().toString().length() != length) { textInputLayout.setError(errorInfo);
textInputLayout.setErrorEnabled(true);
} else {
textInputLayout.setError(null);//必须要添加否则出现空白不隐藏的问题
textInputLayout.setErrorEnabled(false);
}
}

TextInputLayout setError() setErrorEnable()的更多相关文章

  1. Android Design Support Library——TextInputLayout

    前沿 上一篇介绍了NavigationView的主要使用方式,本章主要介绍TextInputLayout的使用方式. TextInputLayout——EditText悬浮标签 TextInputLa ...

  2. Android5.0之TextInputLayout、FloatingActionButton的使用

    TextInputLayout和FloatingActionButton都属于MD风格的控件,比起普通的EditText和Button.ImageButton,TextInputLayout和Floa ...

  3. 第三十一篇-TextInputLayout(增强文本输入)的使用

    效果图: 密码使用的是增强文本输入类型,当密码长度小于6或者密码长度大于10的时候就会给出提示. main.xml 当添加TextInputLayout时,旁边会有一个下载符号,如果点不动,可以右键点 ...

  4. TextInputLayout输入框验证

    <!-- 通过修改<color name="colorAccent">#023cfa</color>可以修改正确提示文本的颜色 添加<item ...

  5. Android Design Support Library使用详解

    Android Design Support Library使用详解 Google在2015的IO大会上,给我们带来了更加详细的Material Design设计规范,同时,也给我们带来了全新的And ...

  6. 一个Activity掌握Design新控件 (转)

    原文地址:http://blog.csdn.net/lavor_zl/article/details/51295364 谷歌在推出Android5.0的同时推出了全新的设计Material Desig ...

  7. Android Material Design(一)史上最全的材料设计控件大全

    主要内容: 本文将要介绍Material design和Support library控件,主要包括TextInputLayout.SwitchCompat.SnackBar.FloatingActi ...

  8. 安卓Design包下的TextInputLayout和FloatingActionButton的简单使用

    终于介绍到Design包的最后的东西了. 也很简单,一个是TextInputLayout. TextInputLayout作为一个父容器,包含一个新的EditText,可以给EditText添加意想不 ...

  9. Android开发2:事件处理及实现简单的对话框(Toast,AlertDialog,Snackbar,TextInputLayout的使用)

    前言 啦啦啦~又要和大家一起学习Android开发啦,博主心里好激动哒~ 在上篇博文中,我们通过线性布局和基础组件的使用,完成了一个简单的学生课外体育积分电子认证系统的界面,本篇博文,将和大家一起熟悉 ...

随机推荐

  1. 如何用Pivot实现行列转换

    在Oracle中,如果要实现行列转换,较为常见的是用DECODE和CASE语句.对于简单的行列转行,DECODE和CASE语句尚能应付.在逻辑比较复杂,分组聚合较多的场景中,DECODE和CASE语句 ...

  2. Perl碎碎念

    1. 如何去重 #!/usr/bin/perl use strict; my %hash; while(<>){ chomp; print "$_\n" unless ...

  3. DDD 主题交流会总结及计划

    思维碰撞才能更加进步 2015年5月16日(上周六),我们举行了一次 DDD 主题的交流会,参会者主要是 ENode 群友.以及部分园友,为什么要搞这次交流会?原因很简单,就是希望可以提供对 DDD ...

  4. Kooboo CMS 之TextContent详解

    TextCotent 在Kooboo.CMS.Content下面,在View中有使用到这个模型层. TextContent继承了ContentBase,而ContentBase是由2个部分类组成的,一 ...

  5. 解读SDN的东西、南北向接口

    北向接口(Northbound Interface)是为厂家或运营商进行接入和管理网络的接口,即向上提供的接口. 南向接口(Southbound Interface)是提供对其他厂家网元的管理功能,支 ...

  6. C#读取数据库中的表

    private int ExistOrNot(string name)    //判断当前数据表是否存在 { con = new SqlConnection(s); DataSet ds = new ...

  7. 基本概念----Beginning Visual C#

    更多相关文章,见本人的个人主页:zhongxiewei.com 变量 注释方式:// 注释在这里和/* 注释在这里 */ 整形变量的类型: Type Alias for Allowed Values ...

  8. mongodb-基础-update-remove

    1.一些操作 collection重命名: > db.post.renameCollection('foo') { "ok" : 1 } > show collecti ...

  9. learn shell

    the basic shell skills.   Bourne shell sh ksh Bash psh zsh C shell csh tcsh   [root@bogon temp]# cat ...

  10. Facebook Paper使用的第三方库

    Facebook Paper使用的第三方库 第三方库名 简介 链接 ACE code editor https://github.com/ajaxorg/ace Appirater 用户评分组件 ht ...