EditText的错误信息
16lz
2021-01-24
EditText可以通过setError来显示错误信息
通过设置application或activity的android: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
TherisnowaytooverridestandardThemeattributeserrorMessageBackgroundanderrorMessageAboveBackground
<!--Applicationtheme.-->
<stylename="AppTheme"parent="android:Theme.Holo.Light">
<itemname="errorMessageBackground">@drawable/ic_launcher</item>
<itemname="errorMessageAboveBackground">@drawable/ic_launcher</item>
</style>
ShowerrorinEclipse
error:Error:Noresourcefoundthatmatchesthegivenname:attr'errorMessageAboveBackground'.
更多相关文章
- Android(安卓)Dialog 全屏
- Android(安卓)布局之GridLayout
- Android(安卓)Spinner 文字居中、其下拉窗口文字居中,自定义Spinn
- Android之WiFi相关类:WiFiConfiguration类的子类和属性
- Android(安卓)EditText 不弹出输入法总结
- Android属性动画源代码解析(超详细)
- Android中实现全屏显示的方法
- android 多窗口模式activity的生命周期
- Android错误之控件FloatingActionButton