Open sonvp opened 7 years ago
@Override public int getItemViewType(int i) { int group = 0; while (group <= getGroupItemCount()) { if (i > 0 && !isExpanded(group)) { i--; group++; continue; } if (i > 0 && isExpanded(group)) { i--; if (i < getChildItemCount(group)) return getChildItemViewType(group, i); i -= getChildItemCount(group); group++; continue; } if (i == 0) return TYPE_HEADER; } throw new IndexOutOfBoundsException();
应该是是因为添加了一个header 导致
Hi @ayalma . I test it with your demo and I add Log in method getGroupItem(int position). I receive bug with Log below 06-09 16:33:03.516 18316-18316/ayalma.ir.sample D/getGroupItem: 0 06-09 16:33:03.521 18316-18316/ayalma.ir.sample D/getGroupItem: 1 06-09 16:33:03.521 18316-18316/ayalma.ir.sample D/getGroupItem: 2 06-09 16:33:03.526 18316-18316/ayalma.ir.sample D/getGroupItem: 3 06-09 16:33:03.526 18316-18316/ayalma.ir.sample D/getGroupItem: 4 06-09 16:33:03.526 18316-18316/ayalma.ir.sample D/getGroupItem: 5 06-09 16:33:03.531 18316-18316/ayalma.ir.sample D/getGroupItem: 6