如何更改微调器文本大小和颜色,而不是在弹出窗口中 window?

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);

并且您可以使用

设置定义下拉视图的布局资源
spinnerAdapter.setDropDownViewResource(R.layout.layout_spinner);

示例布局

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"/>