Skip to content

Bug : scrolling the Collection ad row x also scroll the collections at row x+ny with n = 1,2,3...  #1

@mikall

Description

@mikall

Hi,
thanks for sharing this tutorial, very useful.
Unfortunatelly I think I found a bug.
To see what I mean, please extend the number of section to
var categories = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11","12", "13", "14", "15", "16", "17" ]

and add different color per collection cell (in CategoryRow.swift)

func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCellWithReuseIdentifier("videoCell", forIndexPath: indexPath) as! VideoCell
        if (indexPath.row == 0) {cell.backgroundColor = UIColor.greenColor()}
        if (indexPath.row == 1) {cell.backgroundColor = UIColor.redColor()}
        if (indexPath.row == 2) {cell.backgroundColor = UIColor.blueColor()}
        if (indexPath.row == 3) {cell.backgroundColor = UIColor.purpleColor()}
        if (indexPath.row == 4) {cell.backgroundColor = UIColor.yellowColor()}
        if (indexPath.row == 5) {cell.backgroundColor = UIColor.grayColor()}
        if (indexPath.row == 6) {cell.backgroundColor = UIColor.cyanColor()}
        if (indexPath.row == 7) {cell.backgroundColor = UIColor.clearColor()}
        if (indexPath.row == 8) {cell.backgroundColor = UIColor.blackColor()}
        if (indexPath.row == 9) {cell.backgroundColor = UIColor.brownColor()}
        if (indexPath.row == 10) {cell.backgroundColor = UIColor.darkGrayColor()}
        if (indexPath.row == 11) {cell.backgroundColor = UIColor.orangeColor()}

        return cell
    }

If you scroll row 1, also the row 7 and 13 are scrolled by the same quantity.
If you scroll row 2, also the row 7 and 14 are scrolled.

IMO is something related to the heigh of the display, n x 1.8 x display height the scroll is repeated.

I hope this can help.
Thx,
Michele

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