TextInputLayout 的使用
来源:互联网 发布:Mac怎样设置快捷键 编辑:程序博客网 时间:2024/06/07 00:58
final TextInputLayout til= (TextInputLayout) findViewById(R.id.til);til.setHint("please input some words:");EditText et=til.getEditText();et.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(s.length()>5){ til.setError("some Error"); til.setErrorEnabled(true); }else { til.setErrorEnabled(false); } }});
//xml
<android.support.design.widget.TextInputLayout android:background="#0ff" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/til"> <android.support.design.widget.TextInputEditText android:layout_width="match_parent" android:layout_height="wrap_content" /></android.support.design.widget.TextInputLayout>
0 0
- TextInputLayout 的简单使用
- TextInputLayout的使用
- TextInputLayout的使用
- TextInputLayout的使用
- TextInputLayout 的使用
- TextInputLayout的使用
- android TextInputLayout的使用
- TextInputLayout&TextInputEditText的使用
- TextInputLayout的简单使用
- TextInputLayout的使用
- TextInputLayout的使用
- TextInputLayout的使用
- TextInputLayout的使用
- TextInputLayout的简单使用
- TextInputLayout的使用
- Android:TextInputLayout的简单使用
- TextInputLayout的使用坑点
- 【Android-UI】TextInputLayout的使用
- jTable基础知识:画表格之前要做的事
- xcode8 导致storyboard页面显示不全
- 深入理解 NodeList
- libc.a中FILE结构和相应的函数指针的分析
- 百度地图bug
- TextInputLayout 的使用
- discuz 与YII 的同步登录
- vmwre 桥模式上网, 虚拟机作为一个独立的局域网电脑
- 学习分隔String的应用类 StringTokenizer
- 一些java lambda表达式的笔记
- Leetcode 415. Add Strings 字符串加法 解题报告
- Java ArrayList删除特定元素的方法
- 图像滤镜艺术----Brannan滤镜
- KVO的基本使用