android.support.v7.widget.AppCompatEditText
只有浮动标签
style中添加
#8c8c8c
14sp
#c6174e
#3F51b5
#c6174e
XML
android:id="@+id/til_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/txt_lab">
android:id="@+id/acet_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/txt_password"
有错误提示的
style中添加
#c6174e
12sp
Xml中添加app:errorEnabled="true"
代码设置 til_Password.setError("请输入密码!");
XML
android:id="@+id/til_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/txt_lab"
app:errorEnabled="true"
app:errorTextAppearance="@style/txt_lab_msg"
android:id="@+id/acet_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/txt_password"
搬运一个比较强大的第三方库(很久没更新啦,不建议用)
https://github.com/rengwuxian/MaterialEditText
https://github.com/rey5137/material(这个第三方库,还是比较好的)
领取专属 10元无门槛券
私享最新 技术干货