Android: How to set text color for list items in AlertDialog properly

Viewed 8875

I have an AlertDialog in my application. It contains a list of custom views with TextView widgets inside. Everything works fine on Android 2.x. The AlertDialog is created with white list and black text in it. But when I run my app on Android 3.x devices all TextViews are black and list's background is black too. So I can't see the text until I tap and hold one of the items.

Here's a TextView's definition from the layout file:

<TextView
    android:id="@+id/label"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:singleLine="true"
    android:ellipsize="marquee"
    android:textAppearance="?android:attr/textAppearanceSmallInverse" />

I thought that using textAppearanceSmallInverse for the textAppearance attribute is a proper way to set text parameters and it must work on all devices but seems I was wrong. So what should I do to make AlertDialog display list items properly on all platforms? Thanks in advance.

4 Answers
Related