Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you change the textcolor of the list items in an AlertDialog

Hello I am trying to change the text color of the items in a list on a ListPreference pop up window. I have spent over an hour looking through all of the various style names but I can't find TextAppearance or anything that goes to this particular text. Thanks for your help!

like image 312
Nathan Schwermann Avatar asked Dec 03 '10 07:12

Nathan Schwermann


People also ask

How do I change the color of my AlertDialog button?

You can just create a style and apply that theme on the dialog box. So whenever you want to change the color of AlertDialog box, just change color in styles. xml and all the dialog boxes will be updated in the whole application.

How do I change the font in AlertDialog?

If you only want to change text format, you can just override alertDialogTheme attribute to change the theme for the AlertDialog . <style name="MyTheme" parent="Theme. AppCompat.

Which method is used to set the list in AlertDialog in Android?

The way to make a checkbox list is to use setMultiChoiceItems . // setup the alert builder AlertDialog. Builder builder = new AlertDialog. Builder(context); builder.


1 Answers

You can't and you shouldn't. *Preference uses styles from com.android.internal.R.styleable which might be changed by manufactures. The idea of using the default ones is that every preference screen in your device look alike.

On the other hand you can try doing an Activity with android:theme="@android:style/Theme.Dialog" in your app's AndroidManifest and place a ListView styled as you want.

like image 87
Macarse Avatar answered Sep 16 '22 12:09

Macarse