My app uses Theme.Holo.Light.DarkActionBar
as the parent theme.
When I use my Android 3.2 tablet emulator, the EditText shape is almost impossible to see. It looks like it is trying to draw white on white. Seen here:
When I use it on my Android 4.0 tablet emulator, the EditText shape looks just fine. You can see the dark grey line along the bottom of the EditText. If you look in the above image, you'll just barely see a white line in the same place as it crosses the light grey background watermark.
Here is my EditText in the layout:
<EditText
android:id="@+id/fieldName"
style="@style/PlayerDetails.Field"
android:capitalize="words" />
And here is the style:
<style name="PlayerDetails.Field">
<item name="android:layout_weight">0.65</item>
<item name="android:paddingLeft">10dp</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_marginLeft">10dp</item>
</style>
Why is my EditText getting drawn the wrong color? I'm not overriding the drawing code or the background drawable.
I figure out my issue. By setting theme in application element
android:theme="@android:style/Theme"
in manifest.xml file.Try this.
You can have an action bar and still see the
EditText
light grey background watermark if you use themes like below:AndroidManifest.xml
styles.xml
This works for the theme "android:Theme.Holo.Light" but not for the theme "android:Theme.Holo".
The other answers weren't actually solutions to my problem and I never figured out what was REALLY causing the issue. However, this is how I solved it: My workaround was to copy the .9.pngs and styling for the EditText widget from Ice Cream Sandwich and hardcoded into my app for Honeycomb and Ice Cream Sandwich.
EDIT:
I created a file called res/drawable-nodpi/edit_text_holo_light.xml with the following:
Then I created a style in my styles.xml to set:
Then I copied the .9.png files from the android sdk and put them in res/drawable-*. The filenames are listed in the above xml.