Style Text in Dialog Box

I have a simple DialogFragment that shows some text (which contains the Year string), and then a SeekBar that the user can shift and change the Year string.

On Android 3 and 4, this looks right ... these platforms have a light background and use black text.

enter image description here

However, on Android 2, the dialog has a dark background and still uses black text.

enter image description here

I don’t want to set up different color schemes for different versions of Android, because GOT has some default values ​​built into the Android system that I have to use to style my TextView so that it uses the appropriate text color.

Here is my TextView that displays the string year:

<TextView
    android:id="@+id/textViewYear"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="10dp"
    android:text="1976"
    android:textAppearance="?android:attr/textAppearanceLarge" />

What parameters can be applied to my TextView so that it is always colored accordingly by the system?

, , Android 3 4 . , Android 2, 3 4.

+5
1

SO:

builder.setInverseBackgroundForced(true)

Android 3.x 4.x , Android 2.x , , .

+2

All Articles