zoukankan      html  css  js  c++  java
  • [翻译] JSAnimatedImagesView

    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

  • 相关阅读:
    CoInitialize和CoInitializeEx
    ras api win7 和 win xp 遍历时的不同
    jquery实现多行文字图片滚动效果
    js点击button按钮跳转到页面代码
    phpmailer使用163邮件发送邮件例子
    linux中mail函数不能发送邮件
    FreeBSD修改root密码错误passwd: pam_chau(www.111cn.net)thtok(): error in service module from:http://www.111cn.net/sys/freebsd/66713.htm
    asp.net中c# TextBox.MaxLength例子
    WampServer修改Mysql密码的步骤
    dedecms5.7文章实现阅读全文功能二次开发
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/3978588.html
Copyright © 2011-2022 走看看