@lovesosoi
2017-10-31T08:20:43.000000Z
字数 726
阅读 1313
传统的输入框是 EditText ,在 Material Design 中,增加了一种新样式的输入框 TextInputEditText,是继承与EditText,使用方法基本与 EditText 一致, 一般用的时候在外部嵌套一个TextInputLayout 。显示效果如图:

TextInputLayout属性app:hintAnimationEnabled="true"设置是否可以使用动画,默认是trueapp:hintEnabled="true"设置是否可以使用hint属性,默认是trueapp:hintTextAppearance="@style/MyStyle"设置hint的文本属性,改变hint文字的大小颜色等属性app:counterEnabled="true"设置是否可以开启计数器,默认是falseapp:counterOverflowTextAppearance="@style/MyStyle2"设置计算器越位后的文字颜色和大小app:counterTextAppearance="@style/MyStyle"设置正常情况下的计数器文字颜色和大小app:counterMaxLength="11"设置计算器的最大字数限制app:errorEnabled="true"是否允许错误提示app:errorTextAppearance="@style/MyStyle2"错误提示的文字大小和颜色TextInputEditText 属性和 EditText 差不多就不介绍了
