码迷,mamicode.com
首页 > 其他好文 > 详细

[翻译] MJParallaxCollectionView

时间:2015-06-09 23:16:33      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:

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.

设置非常简单。

  1. Just create a NSString array contaning all the names for the images. 设置一个带有图片名字的字符串数组
  2. Set up the Collection View datasource and delegate methods. 设置CollectionView的datasource以及delegate代理方法
  3. Set the scrollViewDidScroll delegate method for your UICollectionView. 给你的UICollectionView设置scrollViewDidScroll的代理方法
  4. 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

 

技术分享

 

[翻译] MJParallaxCollectionView

标签:

原文地址:http://www.cnblogs.com/YouXianMing/p/4564736.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!