GeezerVison is showing github.com — 添加headerview后 使用ExpandableItem 在 item未满一屏幕情况下 adapter.expandAll 方法无效 子项无法展开 · Issue #1564 · CymChad/BaseRecyclerViewAdapterHelper
添加headerview后 使用ExpandableItem 在 item未满一屏幕情况下 adapter.expandAll 方法无效 子项无法展开 #1564
Description
添加headerview后 使用ExpandableItem 在 item未满一屏幕情况下 adapter.expandAll 方法无效 子项无法展开,去掉headerview后正常
在demo ExpandableUseActivity中添加headerview后:
adapter.setHeaderView(new ImageView(this));
mRecyclerView.setAdapter(adapter);
// important! setLayoutManager should be called after setAdapter
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
adapter.expandAll();
报错:
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1
at java.util.ArrayList.get(ArrayList.java:310)
at com.chad.library.adapter.base.BaseQuickAdapter.getItem(BaseQuickAdapter.java:526)
at com.chad.library.adapter.base.BaseQuickAdapter.getExpandableItem(BaseQuickAdapter.java:1701)
at com.chad.library.adapter.base.BaseQuickAdapter.expandAll(BaseQuickAdapter.java:1564)
at com.chad.library.adapter.base.BaseQuickAdapter.expandAll(BaseQuickAdapter.java:1605)
at com.chad.baserecyclerviewadapterhelper.ExpandableUseActivity.onCreate(ExpandableUseActivity.java:47)
Activity
changed the title
[-]添加headerview后 adapter.expandAll()报错[/-] [+]添加headerview后 使用ExpandableItem 在 item未满一屏幕情况下 adapter.expandAll 方法无效 子项无法展开[/+] on Sep 18, 2017CymChad commented on Sep 19, 2017
CymChad commented on Sep 19, 2017
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
Reacted by fuguiniao, 小宇宙 and xianwei
fuguiniao commented on Sep 19, 2017
Metadata
Metadata
Development
No branches or pull requestsIssue actions