listView = (ListView) findViewById(R.id.list_main);
/*        String[] strings = {"A","A","A","A","A","A","A","A","A"};
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_ctn, strings);*/
        List<Map<String, Object>> arrayList = new ArrayList<Map<String, Object>>();
        Map<String, Object> map = null;
        int i = 0;
        while (i<10) {
            map = new HashMap<String, Object>();
            map.put("name", "zh"+i);
            map.put("age", i);
            arrayList.add(map);
            i++;
        }
        String[] from = {"name", "age"};
        int[] to = {R.id.list_ctn_name, R.id.list_ctn_age};
        SimpleAdapter adapter = new SimpleAdapter(this, arrayList, R.layout.list_ctn, from, to);
        listView.setAdapter(adapter);

<ListView    android:id="@+id/list_main"    android:layout_width="match_parent"    android:layout_height="match_parent"    />

<?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="wrap_content"
    android:orientation="horizontal">

        <TextView
            android:id="@+id/list_ctn_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="TextView" />

        <TextView
            android:id="@+id/list_ctn_age"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="TextView" />
    </LinearLayout>

最新文章

  1. FPGA中的delay与latency
  2. JavaScript parseInt函数
  3. CXF 入门:创建一个基于WS-Security标准的安全验证(CXF回调函数使用,)
  4. Scrum会议2(Beta版本)
  5. iOS - UITabBarController
  6. Oracle EBS 如何月结、对账[Z]
  7. 汽车Vin码识别——&#160;一款二手车行业值得拥有的OCR识别软件
  8. JavaScript面向对象深入理解原型
  9. Python内置函数(46)——oct
  10. sitecore开发入门教程如何获取Sitecore项目的域名
  11. Android各国语言对照表(values-xxx)
  12. springBoot_freemark配置
  13. 在python pydev中使用todo标注任务
  14. rest_framework_api规范
  15. jpa多条件查询重写Specification的toPredicate方法(转)
  16. uboot中CMD的实现
  17. yii的一些方法的解析和blog的详细解析
  18. Replication--复制与CDC和镜像
  19. Socket、RPC通信实例,简单版本,仅供查阅
  20. SCI 美国《科学引文索引》(Science Citation Index, 简称 SCI )

热门文章

  1. [TJOI2009]开关 (线段树)
  2. Cstring中GetBuffer()方法的主要作用
  3. Linux(7):用户管理
  4. 染色(bzoj 2243)
  5. 记录一下 ps命令找出线程占用cpu情况
  6. centos7 安装teamviewer 报错libQt5WebKitWidgets.so.5()(64bit)
  7. windows下模拟linux命令的工具 xshell
  8. Chrome 浏览器安装Vue插件方法 (十分详细)
  9. 解决Linux系统没有/etc/sysconfig/iptables文件
  10. poj 2135 Farm Tour 最小费最大流