冰淇淋三明治打破了EditText的setError()?

Han*_*itt 1 android android-edittext android-4.0-ice-cream-sandwich

我在EditText上使用setError()进行验证.它在升级到ICS之前工作正常,但现在错误框为空.我该如何解决?

Sha*_*dul 8

我能够在运行Android 4.0.3的Nexus S上重现这一点.

这就是我如何使它发挥作用.

  1. 创建一个主题:

    <style name="MyApp.Theme.Light.NoTitleBar" parent="@android:style/Theme.Light.NoTitleBar">
         <item name="android:textColorPrimaryInverse">@android:color/primary_text_light
         </item>
    </style>
    
    Run Code Online (Sandbox Code Playgroud)
  2. MyApp.Theme.Light.NoTitleBar从清单中将主题应用于我的应用程序/活动.

        <application
             android:name=".MyApp"
             android:icon="@drawable/ic_launcher"
             android:label="@string/app_name" 
             android:theme="@style/MyApp.Theme.Light.NoTitleBar"
        >
    
    Run Code Online (Sandbox Code Playgroud)