Skip to content

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

Open

Description

@ZCGObject

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

Activity

  1. xiangcman commented on Jan 25, 2019

    @xiangcman
    Owner
  2. ZCGObject commented on Jan 25, 2019

    @ZCGObject
    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);
    }
    麻烦你了,谢谢!!!

  3. xiangcman commented on Jan 25, 2019

    @xiangcman
    Owner
  4. ZCGObject commented on Jan 25, 2019

    @ZCGObject
    Author

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

  5. xiangcman commented on Jan 25, 2019

    @xiangcman
    Owner

    你加我qq 1002326270

  6. mosentest commented on Feb 28, 2019

    @mosentest

    来了老弟

  7. xiangcman commented on Feb 28, 2019

    @xiangcman
    Owner
  8. mosentest commented on Feb 28, 2019

    @mosentest

    demo没修复吧哥

  9. mosentest commented on Feb 28, 2019

    @mosentest
    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);
            }
  10. xiangcman commented on Feb 28, 2019

    @xiangcman
    Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions