BufferTextInputLayout的简单用法
2017-03-29 13:44
417 查看
这个库你可以很多情况都能派上用场,例如用户资料页,用来做密码或用户名的输入长度控制再适合不过,只需简单地指定字数和字数显示的增减性。如下图所示:
不会做GIF图片,从别的位置拷贝过来的。首先添加依赖,依赖的下载地址
点击跳转github下载
XML格式如下:
<org.buffer.android.buffertextinputlayout.BufferTextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:counterEnabled="true" app:counterMaxLength="10" app:counterOverflowTextAppearance="@style/counterOverride" app:counterTextAppearance="@style/counterText" app:hintEnabled="true" app:counterMode="ascending"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/text_hint" /> </org.buffer.android.buffertextinputlayout.BufferTextInputLayout>
这个控件有两个额外属性app:counterMode(模式)和app:displayFromCount(最大数)。其他属性跟基本控件是一样的。
项目链接
相关文章推荐
- Android Design Support Library(一):FloatingActionButton、TextInputLayout、TextInputEditText简单用法
- Android Design Support Library(一):FloatingActionButton、TextInputLayout、TextInputEditText简单用法
- TextInputLayout和AppCompatButton简单用法
- Android Design Support Library(一):FloatingActionButton、TextInputLayout、TextInputEditText简单用法
- Android开发之TextInputLayout的简单使用(增强EditText)
- 安卓Design包下的TextInputLayout和FloatingActionButton的简单使用
- 《学习记录》TextInputLayout一般用法
- TextInputLayout的简单使用
- Android:TextInputLayout的简单使用
- TextInputLayout的简单使用
- 好简单很酷炫的TextInputLayout
- Android 中 TextinputLayout 的用法
- TextInputLayout 的简单使用
- Material Design之TextInputLayout、Snackbar的使用
- Material Design之TextInputLayout使用示例
- Android M新控件之FloatingActionButton,TextInputLayout,Snackbar,TabLayout的使用
- Adroid MD: TextInputLayout/FloatingActionButton/SnackBar
- Android Design TextInputLayout 解析,带你深入TextInputLayout
- FloatingActionButton,TextInputLayout,Snackbar,TabLayout 四种控件
- android学习之LayoutInflater的用法,在myAdapter getView()里将多个TextView组件压缩成一个View控件,并在listView里显示