2 ccx1070064553 ccx1070064553 于 2017.09.07 18:13 提问

android开发中的ExpandableListView的adapter里的getview是干啥的
public View getChildView(int groupPosition, int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
    ViewHolder holder = null;
    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.main_menu_list_child, null);
        holder = new ViewHolder();
        holder.mChildIcon = (ImageView) convertView.findViewById(R.id.desktop_list_child_icon);
        holder.mChildName = (TextView) convertView.findViewById(R.id.desktop_list_child_name);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }
    AbMenuItem m = mChilds.get(groupPosition).get(childPosition);
    holder.mChildIcon.setImageResource(m.getIconId());
    holder.mChildName.setText(m.getText());
    return convertView;
}

convertView和holder是什么?

Csdn user default icon
上传中...
上传图片
插入图片