Android关于Spinner的使用(更换字体颜色,下拉列表的条目布局)

来源:互联网 发布:mysql from 多表 编辑:程序博客网 时间:2024/05/18 19:40

1.要改变标题字体颜色需要在new出adapter的时候

使用自定义的布局.

<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@android:id/text1"
    android:paddingLeft="5dip"
    android:paddingRight="5dip"
    android:paddingTop="5dp"
    android:paddingBottom="5dp"
    android:gravity="center_vertical"
    android:textColor="@color/font_gray_light"
    android:singleLine="true"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="jjjj"
    />


2.改变下拉列表item布局可以使用

spinnerAdapter.setDropDownViewResource(R.layout.spinner_simple_item);

设置自己想要的条目布局

0 0
原创粉丝点击