[Solved] how to change spinner text size and color, not in the popup window?


Use the below adapter constructor for customizing spinner in the way
you required.

spinnerAdapter = new ArrayAdapter(this, R.layout.row_spinner 
             /* The resource ID for a layout file containing a layout to use when
              instantiating views. */ ,android.R.id.text1, array);

And you can set the layout resource defining the drop down views using

spinnerAdapter.setDropDownViewResource(R.layout.layout_spinner);

Sample layouts

row_spinner

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@android:id/text1"
    style="?android:attr/spinnerDropDownItemStyle"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:ellipsize="marquee"
    android:gravity="center"
    android:singleLine="true"
    android:textColor="@color/colorBlack"
    android:textColorHint="@color/colorBlack"
    android:textSize="@dimen/text_size_l"/>

layout_spinner

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@android:id/text1"
    style="?android:attr/spinnerDropDownItemStyle"
    android:layout_width="match_parent"
    android:layout_height="@dimen/margin_padding_width_height_6"
    android:ellipsize="end"
    android:gravity="center"
    android:singleLine="true"
    android:textColor="@color/colorBlackLight"
    android:textSize="@dimen/text_size_l"/>

0

solved how to change spinner text size and color, not in the popup window?