开发者

Wrong background images in EditText.setError(..) popup

开发者 https://www.devze.com 2023-04-08 11:27 出处:网络
I\'m using EditText.setError(..) to show up an error message if the user did not correctly fill in the formular.

I'm using EditText.setError(..) to show up an error message if the user did not correctly fill in the formular. The app will be for Honeycomb. I tried with both android:style/Theme.Holo and android:style/Theme.Holo.Light.

The Problem is that the background images of the error popup seem to be wrong. There are to images for that background - one, for when the error popup is shown above the EditText and one for when it's shown beneath it. In Theme.Holo the above-image has a black background and the beneath-image has a white background. The text color always is black, so the text is not readable in the above-popup.

Before updating to the latest sdk I was able to "hack" this problem with the following lines of code:

<item name="android:textColorPrimaryInverse">#ffffffff</item>
<item name="android:errorMessageBackground">@drawable/popup_inline_error</item>
<item name="android:errorMessageAboveBackground">@drawable/popup_inline_error_above</item>
开发者_如何转开发

But now with sdk tools 12 I get a compilation error using these lines with the information that e.g. the resource android:errorMessageBackground could not be found...

Any ideas? Thank you! Chris


The linked thread has a solution for this.

The problem also seems to be fixed since Android 4.0.

0

精彩评论

暂无评论...
验证码 换一张
取 消