Text color of a closed spinner

前端 未结 6 1356
孤独总比滥情好
孤独总比滥情好 2020-12-01 16:03

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

6条回答
  •  孤城傲影
    2020-12-01 16:46

    You can change the text colour or can access the textview in setOnItemSelectedListener event,

                spinnerObject.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
                @Override
                public void onItemSelected(AdapterView parentView, View selectedItemView, int position, long id) {
                     ((TextView)parentView.getChildAt(0)).setTextColor(Color.rgb(249, 249, 249));   
    
                }
    

提交回复
热议问题