adapter里getView的标准格式

        public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView,
            ViewGroup parent) {
            View view = convertView;
            ItemViewHolder holder;

            if (view == null) {
                view = inflater.inflate(R.layout.odf_list_item, null);
                holder = new ItemViewHolder();
                holder.itemTitle = (TextView)view.findViewById(R.id.txt_item_title);
                view.setTag(holder);
            } else {
                holder = (ItemViewHolder)convertView.getTag();
            }

            holder.itemTitle.setText(items.get(groupPosition).get(childPosition));

            return view;
        }

 

你可能感兴趣的:(Adapter)