码迷,mamicode.com
首页 > 其他好文 > 详细

ListView

时间:2015-10-27 16:44:09      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:

    class MyAdapter extends BaseAdapter {
        @Override
        public int getCount() {
            return arrayList.size();
        }
        @Override
        public Object getItem(int i) {
            return null;
        }
        @Override
        public long getItemId(int i) {
            return 0;
        }
        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            View lv = View.inflate(getApplicationContext(), R.layout.list_item, null);
            TextView textView2 = (TextView) lv.findViewById(R.id.textView2);
            TextView textView3 = (TextView) lv.findViewById(R.id.textView3);
            TextView textView4 = (TextView) lv.findViewById(R.id.textView4);
            Person person = arrayList.get(i);
            textView2.setText(String.valueOf(person.getId()));
            textView3.setText(person.getName());
            textView4.setText(String.valueOf(person.getAge()));
            return lv;
        }
    }

 

ListView

标签:

原文地址:http://www.cnblogs.com/linson0116/p/4914229.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!