TeehanLax / UICollectionView-Spring-Demo

A demonstration of UICollectionView and UIKit Dynamics
MIT License
472 stars 71 forks source link

Last cell flashing #6

Open rusik opened 10 years ago

rusik commented 10 years ago

I want to increase "bounce" effect and decrease scrollResistance coefficient from 1500 to 500 (or something near it). And have found that last cell is flashing a little. It appears a little later than necessary, in a couple of points of space above bottom.

If set settings like this (big line spacing and small scrollResistance coefficient):

    self.minimumInteritemSpacing = 10;
    self.minimumLineSpacing = 50;
    self.itemSize = CGSizeMake(300, 44);
    self.sectionInset = UIEdgeInsetsMake(30, 10, 10, 10);
...
    springBehaviour.length = 0.0f;
    springBehaviour.damping = 0.8f;
    springBehaviour.frequency = 1.0f;
...
    CGFloat scrollResistance = distanceFromTouch / 500;

you can see this behaviour better

This is video showing what I mean https://cloudup.com/cBqaFANB9ny

Trying to find a solution for two days and have no ideas about it. It repeats with tiling technic and without. And how I found a few seconds ago it repeats randomly from time to time (depends on parameters and your fortune). And it works only with bottom edge.