Change text color of selected item in spinner

后端 未结 14 1522
情深已故
情深已故 2020-11-29 06:17

How can I change the font color of the selected item in a spinner?

I am able to change the background color of the selected item, the color of the dropdown item etc,

14条回答
  •  眼角桃花
    2020-11-29 06:57

    just use this line onItemSelected listner -

    public void onItemSelected(AdapterView parent, View arg1, int arg2,long arg3) 
         {
    
           item = (String) parent.getItemAtPosition(arg2);
    
    
           ((TextView) parent.getChildAt(0)).setTextColor(0x00000000);
    
     }
    

提交回复
热议问题