EditText可以通过setError来显示错误信息
通过设置application或activity的android:theme属性,可以修改错误信息的样式,但是不能自己定义错误信息的样式。
https://code.google.com/p/android/issues/detail?id=55879
Ther is no way to override standard Theme attributes errorMessageBackground and errorMessageAboveBackground
<!-- Application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light" >
<item name="errorMessageBackground">@drawable/ic_launcher</item>
<item name="errorMessageAboveBackground">@drawable/ic_launcher</item>
</style>
Show error in Eclipse
error: Error: No resource found that matches the given name: attr 'errorMessageAboveBackground'.