android:Spinner 设置收起以及展开的字体大小

android:Spinner 设置收起以及展开的字体大小

/**
     * Set the list of labels on a reminder spinner.
     */
    private static void setReminderSpinnerLabels(Activity activity, Spinner spinner,
            ArrayList labels) {
        Resources res = activity.getResources();
        spinner.setPrompt(res.getString(R.string.reminders_label));
        int resource = R.layout.simple_spinner_item;// 收起字体
        ArrayAdapter adapter = new ArrayAdapter(activity, resource, labels);
        adapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item);// // 展开字体
        spinner.setAdapter(adapter);
    }
  • R.string.reminders_label
<TextView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@android:id/text1"
    style="?android:attr/spinnerItemStyle"
    android:singleLine="true"
    android:textSize="12sp"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ellipsize="marquee"
    android:textAlignment="inherit"/>
  • R.layout.simple_spinner_dropdown_item
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    style="?android:attr/spinnerDropDownItemStyle"
    android:singleLine="true"
    android:layout_width="match_parent"
    android:layout_height="@dimen/list_height01"
    android:textSize="12sp"
    android:textColor="@color/color06_transparency13"
    android:ellipsize="marquee"/>

你可能感兴趣的:(android)