android - How to use different text color and size for closed and opened dropdown list in Spinner -


Text after "div class =" itemprop = "text">

I want to show the dropdown list item of spinner address in a different color than the selected item When the spinner dropdown list is closed, how should I edit my Spinner Optimizer to solve this problem

  Public class MySpinner extends ArrayAdapter & LT ;; String & gt; {Private string [] option; Private string mCustomText = ""; Public Micepinner (Reference Reference, String Option []) {Super (Reference, R.Lit.spinner_item, option); this. Option = option; } Public MSPP (reference reference, string option [], int RID) {super (context, resID); this. Option = option; } @ Override public view getView (int position, seeviewview, viewgroup parent) {View View = super.getView (Status, Convertview, Parents); Int specialItemIndex = options.length - 1; Return view; } @ Override Public View getDropDownView (integer status, seeviewview, ViewGroup parent) {super.getDropDownView Return (Status, ConvertView, Parent); }}  

Enter image details here

in other words, I just text color and size of the item circled in red circle in different blue items in the dropdown list ... really need to use R.layout.spinner_item in both the text size and colors used in the layout

you may have your spinner for title text color blue Set (for example), while spinner default color before it just onItemSelected () Apply callback like this :?

  spinner.setOnItemSelectedListener (see new OnItemSelectedListener () {@Override public void onItemSelected (AdapterView & lt; & gt; adapterView, see, int position, long Itemid) {((TextView) View) .setTextColor (Color.BLUE);} @Override Public Zero onNothingSelected (AdapterView & LT;? & Gt; Arg0) {}});  

Make sure your spinner before view a TextView , so you can change the color of text .


Comments