Latest 1.0.3
Homepage https://github.com/twenty-zp/ZPLoopScrollView
License MIT
Platforms ios 7.0, requires ARC
Dependencies AFNetworking
Frameworks UIKit
Authors

使用三个UIImageView实现图片的无限循环,可手动拖拽以及点击交互

添加到你的项目

Cocoapods添加:

直接在Podfile中使用即可

pod 'ZPLoopScrollView', '~> 1.0.2'

手动添加:

  1. 添加ZPLoopScrollView.hZPLoopScrollView.m到你的项目.
    ZPLoopScrollView 需要ARC.
  2. 通过使用ZPLoopScrollView对象方法startTimer和**stopTimer**来启动轮询

使用

- (void)viewDidLoad {
      [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    //    NSString * path = [[NSBundle mainBundle] pathForResource:@"ImageInfo.plist" ofType:nil];
    //    NSDictionary  * dic = [NSDictionary dictionaryWithContentsOfFile:path];
    //    
    //    NSMutableArray * array = [NSMutableArray array];
    //    for (NSString * str  in dic.allKeys) {
    //        UIImage * i = [UIImage imageNamed:str];
    //        [array addObject:i];
    //    }

        [self.view addSubview:self.scrollView];
        //设置展示图片
        //self.scrollView.images = array;
        //设置网络图片
        self.scrollView.imagesURL = @[@"http://img4.duitang.com/uploads/item/201204/11/20120411162656_eJJiZ.jpeg",
                                      @"http://img.ycwb.com/news/attachement/jpg/site2/20110226/90fba60155890ed3082500.jpg",
                                      @"http://imgsrc.baidu.com/forum/pic/item/b03533fa828ba61e78ab1c894134970a314e59cb.jpg",
                                      @"http://pic27.nipic.com/20130227/7224820_020411089000_2.jpg"];
         //设置pageControl在self.scrollView高度的比例,默认为0.8
         self.scrollView.pageControllCenterYScale = 0.5;
         //启动定时器,轮询开始
         [self.scrollView startTimer];
}
#pragma mark - delegate
- (void)scrollViewLoopDidEndClicked:(ZPLoopScrollView *)scrollViewLoop index:(NSUInteger)index
{

}
#pragma mark - setter & getter
 - (ZPLoopScrollView *)scrollView
{
    if (!_scrollView) {
    _scrollView = [[ZPLoopScrollView alloc]initWithFrame:self.view.bounds];
    _scrollView.delegate = self;
    }
    return _scrollView;
}

效果展示

图片循环,可点击

Latest podspec

{
    "name": "ZPLoopScrollView",
    "version": "1.0.3",
    "summary": "Using three UIImageView pictures in an infinite loop, you can manually drag and drop and click on interactive",
    "description": "Using three UIImageView pictures in an infinite loop, you can manually drag and drop and click on interactive (u4f7fu7528u4e09u4e2aUIImageViewu5b9eu73b0u56feu7247u7684u65e0u9650u5faau73af,u53efu624bu52a8u62d6u62fdu4ee5u53cau70b9u51fbu4ea4u4e92)",
    "homepage": "https://github.com/twenty-zp/ZPLoopScrollView",
    "authors": {
        "twenty-zp": "twenty-zp"
    },
    "license": {
        "type": "MIT",
        "file": "ZPLoopScrollView/LICENSE.txt"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/twenty-zp/ZPLoopScrollView.git",
        "tag": "1.0.3"
    },
    "dependencies": {
        "AFNetworking": [
            ">= 3.0.0"
        ]
    },
    "source_files": "ZPLoopScrollView/*.{h,m}",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This