JSAnimatedImagesView

本人测试的效果:

Description:描述

Easy to use UIView subclass to quickly add a cool animated carrousel of pictures to your app.

Documentation: http://cocoadocs.org/docsets/JSAnimatedImagesView/

可以非常简易的将旋转木马效果添加到你的应用当中。

Usage:使用

  • Using CocoaPods:
  • Add pod 'JSAnimatedImagesView', '~> 1.0.' to your Podfile.
  • You're done!

-- or --

  • Clone the repository:
$ git clone git@github.com:JaviSoto/JSAnimatedImagesView.git
  • Update the submodules:
$ git submodule update --init
  • Check out the sample project. 检查项目文件
  • Drag the two files JSAnimatedImagesView.(h/m) onto your project. 将这两个文件JSAnimatedImagesView.(h/m)拖入到你的工程项目当中
  • Drag Dependencies/MSWeakTimer/MSWeakTimer.(h/m) onto your project. 将这两个文件/MSWeakTimer/MSWeakTimer.(h/m)拖入到你的工程项目当中
  • Include the header file JSAnimatedImagesView.h into the controller where you want to use it. 添加上头文件
  • Create a JSAnimatedImagesView instance either via code, or in interface builder (by creating a UIView and changing its class to JSAnimatedImagesView). 通过代码创建出JSAnimatedImagesView的实例对象,或者通过IB
  • Set the data source property on the view (probably on the viewDidLoad method): 设置图片数据源即可
self.animatedImagesView.dataSource = self;
  • Implement the data source methods: 实现data source方法
@interface MyViewController () <JSAnimatedImagesViewDataSource> // Conform to the protocol

@end
@implementation MyViewController

- (NSUInteger)animatedImagesNumberOfImages:(JSAnimatedImagesView *)animatedImagesView
{
return self.myImageNames.count;
} - (UIImage *)animatedImagesView:(JSAnimatedImagesView *)animatedImagesView imageAtIndex:(NSUInteger)index
{
return [UIImage imageNamed:[self.myImageNames objectAtIndex:index]];
} @end

Configuration:配置

@property (nonatomic, assign) NSTimeInterval timePerImage;

Specifies the time each image is viewed until the next image is faded in.

精确设置每一张淡入淡出的图片的时间

@property (nonatomic, assign) NSTimeInterval transitionDuration;

Specifies the duration of the transition (fade-out/fade-in) animation.

精确设置淡入淡出的时间间隔

Compatibility:兼容性

  • JSAnimatedImagesView is compatible with iOS5.0+ 兼容iOS5.0+以上
  • JSAnimatedImagesView requires ARC. 需要开启ARC

[翻译] JSAnimatedImagesView的更多相关文章

  1. 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...

  2. 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...

  3. [翻译]开发文档:android Bitmap的高效使用

    内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...

  4. 【探索】机器指令翻译成 JavaScript

    前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...

  5. 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...

  6. 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...

  7. 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...

  8. 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?

    0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...

  9. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点

    在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...

随机推荐

  1. No result defined for action and result input

    今天在编程的时候,我遇到了No result defined for action and result input的错误,这个错误想必大家都有遇到过吧,我今天发了很长时间弄这个错误,我以为我的Act ...

  2. 724_Find-Pivot-Index

    目录 724_Find-Pivot-Index Description Solution Java solution Python solution 724_Find-Pivot-Index Desc ...

  3. Ruby(2): 基本语法上

    表达式和变量: 这两点和其他主流的编程语言基本没有差别,这里直接跳过. 需要注意的是 ruby中 x=x+1 可以写成 x+=1 但是不支持 x++ , x-- 等一元运算符  比较运算符和表达式: ...

  4. [转载]Vue 2.x 实战之后台管理系统开发(一)

    2. 开发前须知 我的后台管理系统项目运用了如下框架/插件: Vue 2.x —— 项目所使用的 js 框架,我所使用的版本是:2.1.10 vue-router 2 —— Vue 2.x 配套路由, ...

  5. yii2 页面加载警告框

    在视图页面代码如下 <?php use kartik\alert\Alert; echo Alert::widget([ 'type' => Alert::TYPE_INFO, 'titl ...

  6. VS设置护眼色

    打开vs2013 选项 环境...如图所示

  7. java技术秘籍 转摘

  8. ‘Starting Tomcat v9.0 Server at localhost’ has encountered a problem.

    上述错误是在将Web应用部署到Tomcat,最后一步 右键单击选择Start的时候报错,原因是我在启动Tomcat之前,就已经运行了Tomcat,导致端口被占用.将之前的Tomcat关闭重新启动就可以 ...

  9. JS获取今天年月日

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  10. JavaScript中各存在性函数

    JavaScript中有很多表示存在性和从属关系的函数,本文介绍如下几个: 1)有关实例与构造函数原型之间的关系:isPrototypeOf(),Object.getPrototypeOf(); 2) ...