JSAnimatedImagesView 1.0.0

JSAnimatedImagesView 1.0.0

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布上次发布2014年12月

Javier Soto维护。



  • 作者:
  • Javier Soto

描述

这是一个非常容易使用的UIView子类,可以快速地在您的应用程序中添加一个酷炫的图片滚动轮播。

文档: http://cocoadocs.org/docsets/JSAnimatedImagesView/

示例

Video

http://jsoto.es/xmKcLb

使用方法

  • 使用CocoaPods
  • pod 'JSAnimatedImagesView', '~> 1.0.'添加到您的Podfile中。
  • 完成!

-- 或 --

  • 克隆仓库
$ git clone [email protected]:JaviSoto/JSAnimatedImagesView.git
  • 更新子模块
$ git submodule update --init
  • 查看示例项目。
  • 将两个文件JSAnimatedImagesView.(h/m)拖到您的项目中。
  • Dependencies/MSWeakTimer/MSWeakTimer.(h/m)拖到您的项目中。
  • 在您想要使用JSAnimatedImagesView的控制器中包含头文件JSAnimatedImagesView.h
  • 通过代码或interface builder(通过创建一个UIView并将其类更改为JSAnimatedImagesView)创建一个JSAnimatedImagesView实例。
  • 设置视图的数据源属性(可能在viewDidLoad方法中)
self.animatedImagesView.dataSource = self;
  • 实现数据源方法
@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

配置

@property (nonatomic, assign) NSTimeInterval timePerImage;

指定每个图片显示的时间,直到下一个图片淡入。

@property (nonatomic, assign) NSTimeInterval transitionDuration;

指定过渡动画(淡出/淡入)的持续时间。

兼容性

  • JSAnimatedImagesView与iOS5.0+兼容
  • JSAnimatedImagesView需要ARC。

致谢(Creative Commons_images)

许可证

JSAnimatedImagesView在MIT许可证下可用。有关更多信息,请参阅LICENSE文件。