[翻译] MJParallaxCollectionView

简介:

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

 

 

目录
相关文章
TortoiseSVN不支持中文路径
TortoiseSVN不支持中文路径
349 0
|
网络安全 C++
【Azure Developer】Visual Studio 2019中如何修改.Net Core应用通过IIS Express Host的应用端口(SSL/非SSL)
【Azure Developer】Visual Studio 2019中如何修改.Net Core应用通过IIS Express Host的应用端口(SSL/非SSL)
419 0
|
JavaScript 前端开发
jQuery和CSS3斑马线样式range滑块特效
jQuery和CSS3斑马线样式range滑块特效
|
SQL XML Java
MyBatis-plus超神用法--一文带你玩转MP
MyBatis-plus超神用法--一文带你玩转MP
913 0
|
存储 算法 安全
Etcd 初步认识
近期在接触的新项目中在使用Etcd,但是在使用的过程中公司对其的使用仅使用服务注册的功能,并未将其发挥真正的用处。学习一波,将来可以在项目中使用进行改进。
440 0
带你读《2022技术人的百宝黑皮书》——Short-Video Marketing in E-commerce: Analyzing and Predicting Consumer Response(7)
带你读《2022技术人的百宝黑皮书》——Short-Video Marketing in E-commerce: Analyzing and Predicting Consumer Response(7)
281 0
|
JavaScript IDE 开发工具
基于node.js开发的文章生成器(一、准备章)
# 引言 今天带来的是狗屁不通文章生成器第一部分,即输入一个文章题目,和相应的字数,便自动生成一篇对应字数的文章。 ![image.png](https://ucc.alicdn.com/pic/developer-ecology/y3obldvnqeb54_1ef6d9d62323412f9e4edef8737f9f10.png) 如上图 那么这么好玩的文章生成器是怎么制作的,接下来带大家制作这个文章生成器 # 准备 首先创建一个文件夹article,然后切换到article目录下,调出cmd,执行如下代码完成项目的初始化 `npm init -y` 它会在项目目录下生成一个 pac
|
存储 小程序 API
uni-app黑马优购项目学习记录(五)
uni-app黑马优购项目学习记录(五)
uni-app黑马优购项目学习记录(五)