-4

how to change the text color of the spinner, the text which is on the left side of the dropdown button? ("Denmark" in the picure)

enter image description here

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Andreisk
  • 33
  • 1
  • 10
  • I don't know why all the down-votes -- this seems a reasonable question to me. I don't know the answer, but I know what is being asked. This might help: https://stackoverflow.com/questions/13703233/style-android-spinner – Kevin Boone Oct 04 '17 at 14:15

1 Answers1

1

You have to try like this

public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
   TextView selectedText = (TextView) parent.getChildAt(0);
   if (selectedText != null) {
      selectedText.setTextColor(Color.RED);
   }
}
Raja
  • 2,775
  • 2
  • 19
  • 31