EditText的错误信息

EditText可以通过setError来显示错误信息


 

通过设置applicationactivityandroid:theme属性,可以修改错误信息的样式,但是不能自己定义错误信息的样式。

http://stackoverflow.com/questions/13874197/androiderrormessagebackground-getting-no-resource-found-error-in-styles-xml

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'.

猜你喜欢

转载自epy.iteye.com/blog/2261167