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

对于布局有什么要求吗,为什么报错, #11

Open
liguangze opened this issue Oct 16, 2017 · 0 comments
Open

对于布局有什么要求吗,为什么报错, #11

liguangze opened this issue Oct 16, 2017 · 0 comments

Comments

@liguangze
Copy link

Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.

/**
* 设置数据适配器
* @param adapter
*/
public void setAdapter(FlowAdapter adapter) {
mAdapter = adapter;
if (mAdapter.getCount() != 0) {
for (int i = 0; i < mAdapter.getCount(); i ++) {
View view = mAdapter.getView(i);
addView(view);
}
requestLayout();
}
}

addView的时候报错呢,我在下面初始化了一个list,有影响吗

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

No branches or pull requests

1 participant