Text color of a closed spinner

前端 未结 6 1355
孤独总比滥情好
孤独总比滥情好 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:31

    Just try this:

    public void onItemSelected(AdapterView parent, View view, int position, long id) { ((TextView)parent.getChildAt(0)).setTextColor(getResources().getColor(R.color.colorPrimary));

提交回复
热议问题