android Spinner自定义开发
1、新建一个android工程,名称SpinnerSelfShow,其他参数可以自己设置,参见下图

2、开始对下拉框的样式进行定义,配置布局文件item.xml,里面放入迷撞笸痉两个textview文本显示<?xml version="1.0" encod足毂忍珩ing="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" > <TextView android:id="@+id/one" android:layout_width="wrap_content" //适应自身宽度 android:layout_height="wrap_content" //适应自身高度 android:drawableLeft="@drawable/icon"//文本左边的图像 android:paddingRight="8dip" //距离左边的距离 android:paddingTop="8dip" //距离屏幕的距离 android:text="TextView" //显示的文本 android:textSize="25sp" /> //设置文本字体 <TextView android:id="@+id/two" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="8dip" android:paddingTop="8dip" android:text="TextView" android:textSize="25sp" /></LinearLayout>




