ashfurrow / ashspringycollectionview Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I've been using the flow layout code from this tutorial for awhile now as a base for adding UIKit Dynamics to my collection views in small side projects, however I just noticed something strange now that I'm working on a more serious project.
I am using nearly identical code from the tutorial @ http://www.objc.io/issue-5/collection-views-and-uidynamics.html
I went all the way to and completed the "Adding New Rows"
section but did not move on to the "Tiling your Dynamic Behaviors for Performance"
section.
The only thing I'm doing differently is I'm not calling resetLayout
on the flow layout right after reloading the collection view's data, otherwise for some reason I get trapped in the resetLayout
method and it just keeps getting called over and over.
So now I'm just observing for value changes to the collection view's contentSize
property. When this changes, then I call resetLayout
on the flow layout. This works perfectly the first time it is called. However, when I scroll down far enough, I make another call to my server for more data, add the data to my data array, and reload the collection view.
The new cells are successfully added and visible, but now all of the cells lose their animation. There are no UIKit Dynamics in play anymore, and its just basic flat scrolling.
I've been playing around with this for awhile and can't seem to figure out what is going wrong.
I'm going to take some more time tomorrow to try and figure this out, and if I can't get it I'll probably just use the teehanlax flow layout that this tutorial was based off of.
I just wanted to open this issue in case anyone else has experienced this problem and has a fix and also hopefully it can help anyone else who comes across this problem in the future.
I use the ASHSpringyCollectionView in my project. It works prefect.but It has a bed bug:when the content height less than screen height,the ASHSpringyCollectionView can't scroll!hope you can solve it,thanks~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.