How can I change the color of the dialog items from black to white?


Ivan Patrice:

I am using the following theme in the dialog:

<style name="AlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
    <item name="android:textColorSecondary">@color/colorWhite</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:background">@color/colorPrimary</item>
    <item name="android:textColor">@color/colorWhite</item>
    <item name="android:textColorAlertDialogListItem">@color/colorWhite</item>
</style>

Everything works fine, but the item text color doesn't change. I must be white, but for some reason it's still there. How can I change the text to white? thanks

enter image description here

edit:

Here is my AppTheme:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:textColorSecondary">@color/colorWhite</item>
</style>
BlueMist:

You can refer to AlertDialog topic: How to change the color of item text?

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    ...
    <item name="textColorAlertDialogListItem">@color/colorWhite</item>
</style>

or

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    ...
    <item name="alertDialogTheme">@style/AlertDialogStyle </item>
</style>

<style name="AlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
    ...
    <item name="textColorAlertDialogListItem">@color/colorWhite</item>
    <!--
    <item name="android:textColor">@color/colorWhite</item>
    -->
</style>

You can also change android:textColor but it will change all text color in dialog window

Related


How can I change the plot line color from blue to black?

HG: I'm stuck when I generate a set of data and try to draw a plot line in python. For example, here I want to change the line color from blue to black. This is what I have, returning the dataset I got from pandas. ax=plt.gca() ax.set_axis_bgcolor('#cccccc') r

How can I change the plot line color from blue to black?

HG: I'm stuck when I generate a set of data and try to draw a plot line in python. For example, here I want to change the line color from blue to black. This is what I have, returning the dataset I got from pandas. ax=plt.gca() ax.set_axis_bgcolor('#cccccc') r

How can I change the plot line color from blue to black?

HG: I'm stuck when I generate a set of data and try to draw a plot line in python. For example, here I want to change the line color from blue to black. This is what I have, returning the dataset I got from pandas. ax=plt.gca() ax.set_axis_bgcolor('#cccccc') r

How to change pdf from black and white to specific color?

5rrrrr I'm stapling and trying to print without black ink. Some people recommend doing this on a PC, but I do it on a Mac. Also, I'd rather do this with an online action that converts the file into something I can print. dca This is a website that takes a PDF,