Android EditText.setError() yields invisible error text

后端 未结 5 1223
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-08 21:17

I have a very simple EditText, as follows:



        
5条回答
  •  情深已故
    2020-12-08 21:51

    I had the same problem. In my case, I had applied the parent="android:Theme.Light" to values-V14/styles.xml. This made the EditText control to look like a control from android API 2.3.3 and below. But the error message text was all white and hence, was not visible. After some head scratching I figured this out.

    Change the parent="android:Theme.Light" to parent="android:Theme.Holo.Light.NoActionBar" (what ever Holo theme). But in the EditText definition add android:background="@android:drawable/edit_text"

    My EditText looks like this

    
    

提交回复
热议问题