How to change spinner text size and text color?

后端 未结 24 1966
囚心锁ツ
囚心锁ツ 2020-11-22 11:35

In my Android application, I am using spinner, and I have loaded data from the SQLite database into the spinner, and it\'s working properly. Here is the code for that.

24条回答
  •  青春惊慌失措
    2020-11-22 12:12

    The easiest way to re-use/change the android.R.layout resources is just go the definition. In Android Studio, do Ctrl + B on android.R.layout.simple_spinner_item.xml.

    It will take you to the resource file. Just copy the resource file and add a new layout in your Package.R.layout folder and change the textColor of textview as you like and then just call it in adapter like this:

    ArrayAdapter adapter = new ArrayAdapter

提交回复
热议问题