I understand that the closed spinner is actually a View, I think. But I am guessing it has a TextView there somewhere to show the text. How do I get access to that TextView so I can change the textcolor?
EDIT: I need to change this programatically on the fly, not in the XML.
TextView v = (TextView) getView(mySpinner);
v.setTextColor(.....
This doesnt work...
Thank you!
array_typ=new String[5];
array_typ[0]="Pressure";
array_typ[1]="Level";
array_typ[2]="Overage";
array_typ[3]="Under";
array_typ[4]="Taken";
adaptertyp = new ArrayAdapter<Object>(this,R.layout.simple_spinner_item, array_typ);
typ.setAdapter(adaptertyp);
Yes. Specifically, it is whatever you told your
SpinnerAdapterto create.That would depend on what you told your
SpinnerAdapterto create.Ideally, you don't -- you give it the right color in the first place, via whatever you told your
SpinnerAdapterto create. If the color varies, overridegetView()in yourSpinnerAdapterand change the color at that point.In a pinch, you can try calling
getSelectedView()to get the currentViewbeing shown by the closedSpinner, but whatever change you make here may be eliminated on the user's next selection, and the alternate color may return later on if the earlierViewgets recycled.