Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 4.0+ EditText 并且必须对一堆字段执行验证。当验证失败时,我必须将 EditText 的颜色更改为红色并显示一条消息。现在,我已经使用样式和主题轻松自定义了 EditText,但是没有可以在状态列表可绘制中使用的错误状态。关于如何实现这一点的任何想法?
为什么不使用EditText.setError(CharSequence error)
EditText.setError(CharSequence error)
结果将如下所示
我使用LevelListDrawables让它工作