Spinner

下拉列表项的配置方式
   a.资源文件配置
     第一步:在string.xml配置
      <string-array name ="citys">
       <item>上海</item>
       <item>长沙</item>
       <item>深圳</item>
      </string-array>
     第二步:指定资源
      android:entries="@array/citys"
      b.适配器配置
       第一种:资源配置
        ArrayAdapter<CharSequence> adapter =
   ArrayAdapter.createFromResource(
    this,资源id,
    列表显示的样式);
  第二种:列表配置
   ArrayAdapter<CharSequence> adapte =
   new ArrayAdapter<CharSequence>(
    this,列表显示的样式,集合数据);

posted @ 2017-05-18 19:44  李李李i  阅读(143)  评论(0编辑  收藏  举报