欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

SpinnerAdapter 使用

程序员文章站 2022-05-16 11:22:31
...

 

  String[] fromArr = {"tableChnName"};
                    int[] toArr = {R.id.doc_top_flt_sp_item_tv_title};
                    XLog.showArgsInfo(Arrays.toString(fromArr));
                    SpinnerAdapter adapter = new SimpleAdapter(DocumentActivity.this, spOffCategoryDatas,
                            R.layout.doc_top_flt_sp_item, fromArr, toArr);
                    spOffCategory.setAdapter(adapter);

doc_top_flt_sp_item.xml 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/doc_top_flt_sp_item_tv_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:textColor="@color/black"
        android:textSize="17sp" />
</LinearLayout>
        Map<String, String> args0 = new HashMap<>();
        args0.put("tableChnName", "全部");
        args0.put("tableName", "");
        args0.put("tableChnName", "全部");
        args0.put("tableName", "");
        args0.put("tableChnName", "全部");
        args0.put("tableName", "");
        args0.put("tableChnName", "全部");
        args0.put("tableName", "");
        args0.put("tableChnName", "全部");
        args0.put("tableName", "");
        spOffCategoryDatas.add(args0);

 

相关标签: 安卓相关