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)
Asked
Active
Viewed 2,160 times
-4
-
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 Answers
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