如何将图像添加到父级的可扩展列表视图中?

how to add images to the expandable list view for the parent?

如何在可扩展列表视图中使用 imageheader?

public View getGroupView(int groupPosition, boolean isExpanded,
        View convertView, ViewGroup parent) {



    return convertView;
}

仍然不确定什么是 imagehader 但要在 expandablelistview 中设置图像 header 你应该这样做:

@Override
public View getGroupView(int listPosition, boolean isExpanded,
                         View convertView, ViewGroup parent) {

    if (convertView == null) {
        LayoutInflater layoutInflater = (LayoutInflater) this.context.
                getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = layoutInflater.inflate(R.layout.your_layout, null);
    }


    ImageView imageheader = (ImageView) convertView.findViewById(R.id.imageheader);
    return convertView;
}