Skip to content

出现空白是因为计算右侧补充数量不对 #4

@Nemocdz

Description

@Nemocdz
_addRightCount = [_collectionView  indexPathForItemAtPoint:CGPointMake(self.frame.size.width - 1, 0)].row + 1 ;

这行代码执行时,row 的结果永远是 0,导致只会在右边补充 1 个,而当第一个特别短的时候,应该补充 2 个。没有深究究竟为什么会是 0。解决方法是在前面的循环里计算补充个数。

if (contentSize.width < self.frame.size.width) {
     _addRightCount++;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions