michael
michael

Reputation: 110530

How can I configure the color of the text in a dialog

In android selection dialog, like this example, http://labs.makemachine.net/2010/03/android-multi-selection-dialogs/

How can I specific the color of the text in the dialog? e.g. the color of the text "Mars", "Jupiter"?

Upvotes: 0

Views: 923

Answers (2)

Kevin Coppock
Kevin Coppock

Reputation: 134664

If you just want to change the text color, just make a duplicate of that select_dialog_multichoice XML layout, title it what you want (e.g select_dialog_multichoice_red.xml), and change the textColor attribute to what you would like instead. Then use this XML file for your adapter, instead of the Android default.

If you are wanting items colored based on variables, you would need to do as Cristian said and create a custom View. Override getView(), and then in there you can set the text color with whatever specific code handles your color choice.

Upvotes: 1

Cristian
Cristian

Reputation: 200080

In that case, you will have to create the view of the Dialog manually. Here's an example of how to do that: Creating a Custom Dialog

Upvotes: 0

Related Questions