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

刷新数据后 每个标签之间的间距变大 #24

Open
ZCGObject opened this issue Jan 24, 2019 · 10 comments
Open

刷新数据后 每个标签之间的间距变大 #24

ZCGObject opened this issue Jan 24, 2019 · 10 comments

Comments

@ZCGObject
Copy link

调用notifydatasetchanged后 标签的间距变得超大 , 并且没找到你在哪里有设置标签的间距

@xiangcman
Copy link
Owner

xiangcman commented Jan 25, 2019 via email

@ZCGObject
Copy link
Author

我运行的应该就是你最新的代码。我发现是因为这句代码 productHolder.des.addItemDecoration(new SpaceItemDecoration(dp2px(10))); 刷新时重复添加造成的。 你提交的最新的有处理这里吗?
我自己加了一个条件判断暂时解决了,你可以看一下会有什么问题吗?
public ArrayList spaceItemDecorations = new ArrayList<>();
if(position >= spaceItemDecorations.size()){
SpaceItemDecoration spaceItemDecoration = new SpaceItemDecoration(dp2px(10), dp2px(5));
spaceItemDecorations.add(spaceItemDecoration);
productHolder.des.addItemDecoration(spaceItemDecoration);
}
麻烦你了,谢谢!!!

@xiangcman
Copy link
Owner

xiangcman commented Jan 25, 2019 via email

@ZCGObject
Copy link
Author

能告知一下怎么判断不为空的吗?

@xiangcman
Copy link
Owner

你加我qq 1002326270

@mosentest
Copy link

来了老弟

@xiangcman
Copy link
Owner

xiangcman commented Feb 28, 2019 via email

@mosentest
Copy link

demo没修复吧哥

@mosentest
Copy link

Object tag = productHolder.des.getTag();
        if (tag == null || (tag instanceof Boolean && (Boolean) tag == false)) {
            productHolder.des.addItemDecoration(new SpaceItemDecoration(dp2px(10)));
            productHolder.des.setTag(true);
        } else {
            //productHolder.des.setTag(false);
        }

@xiangcman
Copy link
Owner

xiangcman commented Feb 28, 2019 via email

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

3 participants