Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

左上角的那个单元格,每次notifyDataSetChanged()都会添加新View到FrameLayout,且旧View没有移除 #20

Open
zhuanglee opened this issue Sep 6, 2017 · 2 comments · May be fixed by #40

Comments

@zhuanglee
Copy link

左上角的那个单元格是TextView,更改其文本内容时,会和前一次的值叠加在一起显示

@zhuanglee
Copy link
Author

zhuanglee commented Sep 6, 2017

下面是ScrollablePanel的部分代码:
private void setUpFirstItemView(PanelAdapter panelAdapter) {
RecyclerView.ViewHolder viewHolder = panelAdapter.onCreateViewHolder(firstItemView, panelAdapter.getItemViewType(0, 0));
panelAdapter.onBindViewHolder(viewHolder, 0, 0);
firstItemView.addView(viewHolder.itemView);
}

@zhuanglee
Copy link
Author

继承ScrollablePanel重写notifyDataSetChanged方法解决了
@OverRide
public void notifyDataSetChanged() {
firstItemView.removeAllViews();
super.notifyDataSetChanged();
}

@zhuanglee zhuanglee changed the title 左上角的那个单元格是否每次notifyDataSetChanged()都会重新添加新View,且旧View没有移除 左上角的那个单元格,每次notifyDataSetChanged()都会添加新View到FrameLayout,且旧View没有移除 Sep 6, 2017
rt1shnik added a commit to rt1shnik/ScrollablePanel that referenced this issue May 6, 2019
Problem: after every notifyDataSetChanged ScrollablePanel creates and adds new view to top-left cell (first header) that lead to large memory leak and lags.
Closes Kelin-Hong#20
rt1shnik added a commit to rt1shnik/ScrollablePanel that referenced this issue May 6, 2019
Problem: after every notifyDataSetChanged ScrollablePanel creates and adds new view to top-left cell (first header) that lead to large memory leak and lags.
Closes Kelin-Hong#20
@rt1shnik rt1shnik linked a pull request May 6, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant