首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Android学习笔记 AppCompatEditText

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(这个第三方库,还是比较好的)

  • 发表于:
  • 原文链接http://kuaibao.qq.com/s/20180320G1P53400?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券