这是一个非常容易使用的UIView子类,可以快速地在您的应用程序中添加一个酷炫的图片滚动轮播。
文档: http://cocoadocs.org/docsets/JSAnimatedImagesView/
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.h
。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在MIT许可证下可用。有关更多信息,请参阅LICENSE文件。