Closed bryanluby closed 11 years ago
Great find! I'm out of town at the moment but will take a look when I get back.
In the mean time, feel free to take a crack at it and issue a pull request :beers:
I'm a bit stuck on this. I've tried explicitly calling [self.collectionViewLayout invalidateLayout]
and prepareLayout
from inside the view controller during a rotation by implementing didRotateFromInterfaceOrientation
, but it doesn't seem to have any effect.
I also tried tracking rotation inside the layout class by creating a property for storing the current UIDeviceOrientation
. Every time prepareLayout
is called I envoked [[UIDevice currentDevice] orientation]
and checked if the new orientation is different from the current property's orientation . This doesn't seem like the best approach though since UIDeviceOrientation
also includes FaceUp, FaceDown, etc.
@bryanluby Here's my fix. Not the most elegant, but that sort of approach will work. You could also compare the bounds size, which would probably be preferable.
The trick is to remove the behaviours from the dynamic animator to force them to be re-added in prepareLayout
. Does that make sense?
When you've had a chance to look over the Pull Request #3 , let me know.
Thanks, I looked at Pull Request #3. It works and it makes perfect sense to remove all behaviors from the dynamic animator after detecting an orientation change.
Great! I've merged the PR. Thanks for opening the issue!
If I enable device rotation in build settings, some collectionViewCells are rendered partially off-screen after rotating the device.
Steps: