MJParallaxCollectionView
https://github.com/mayuur/MJParallaxCollectionView
This is a parallax for the cells inside UICollectionView. It gives us an effect just like scrolling the images in Whatsapp or scrolling through the Weather app for iOS.
这是一个cell的视差效果控件,用于UICollectionView当中。你可以在Whatsapp以及Weather app中查看到这种效果。
Setting it up is really simple.
设置非常简单。
- Just create a NSString array contaning all the names for the images. 设置一个带有图片名字的字符串数组
- Set up the Collection View datasource and delegate methods. 设置CollectionView的datasource以及delegate代理方法
- Set the scrollViewDidScroll delegate method for your UICollectionView. 给你的UICollectionView设置scrollViewDidScroll的代理方法
- That's it. Now run! 就酱紫,直接运行吧!
Optionally, you can change the animation speed for the images or the height of the images in the UICollectionViewCell by chnaging the constants used in MJCollectionViewCell.h
作为一个额外的操作(但不是必须的),你可以修改图片动画的速度,也可以在 MJCollectionViewCell.h 文件中修改图片的图片的高度。
Thanks!
Follow me or ask questions or just say Hi! at Twitter : @mayuur
Watch the demo below