Latest 1.3
Homepage https://github.com/busylife1987/BLCycleImageView
License MIT
Platforms ios 8.0, requires ARC
Dependencies SDWebImage
Authors

iOS图片轮播

BLCycleImageView是一个无限循环的图片轮播控件,采用UIScrollView来实现,使用简单方便。

如何使用

    BLCycleImageView *cycleImageView = [BLCycleImageView cycleImageViewWithFrame:self.view.frame imageUrlGroup:@[@"",@""]];

    cycleImageView.autoMoving = NO;//设置是否自动定时轮播,默认为YES

    cycleImageView.autoMoveInterval = [NSNumber numberWithInt:2.0];//设置定时轮播间隔时间,默认为3s

    cycleImageView.showPageControll = NO;//设置是否显示pagecontroll控件,默认显示

    cycleImageView.pagecontrollPosition = PageControllPositionTypeOfLeft;//设置pagecontroll显示位置,默认显示在底部中间

    cycleImageView.placeholderImg = [UIImage imageNamed:@""];//设置占位图片

    cycleImageView.imageTitles = @[@"",@""];//设置图片描述,必须和图片格式保持一致,且pagecontrollPosition不等于PageControllPositionTypeOfCenter

    或者
    BLCycleImageView *cycleImageView = [BLCycleImageView cycleImageViewWithFrame:self.view.frame imageUrlGroup:@[@"",@"" placeHodlerImage:[UIImage imageNamed:@"" delegate:nil]]];

    //需要监听图片点击事件,实现代理CycleImageViewDelegate
    - (void)cycleImageView:(BLCycleImageView *)cycleImageView didClickImage:(NSUInteger)imageIndex;
    

在cell中如何使用

        BLCycleImageViewCell *cycleImageCell;
        cycleImageCell = [_tabView dequeueReusableCellWithIdentifier:cycleImageCellIdentifer];
        if (!cycleImageCell) {
            cycleImageCell = [[BLCycleImageViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cycleImageCellIdentifer];
            cycleImageCell.delegate = self;
        }
        cycleImageCell.imageArr = imageUrlArr;

效果展示

带图片说明文字和不带的效果

Screenshots gif1      Screenshots gif1

依赖库

SDWebImage

安装

  • 使用 CocoaPods安装

    platform: iOS, '8.0'
    pod 'BLCycleImageView','~>1.3'
  • 手动安装
    下载源文件,在需要的ViewController添加引用

    #import "BLCycleImageView.h"
    #import "BLCycleImageViewCell.h"

Latest podspec

{
    "name": "BLCycleImageView",
    "version": "1.3",
    "summary": "u56feu7247u65e0u9650u8f6eu64adu5668uff0cu7b80u5355u6613u7528uff01",
    "homepage": "https://github.com/busylife1987/BLCycleImageView",
    "license": "MIT",
    "authors": {
        "busylife1987": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/busylife1987/BLCycleImageView.git",
        "tag": "1.3"
    },
    "source_files": "BLCycleImageView/*",
    "requires_arc": true,
    "dependencies": {
        "SDWebImage": [
            "~> 3.7"
        ]
    }
}

Pin It on Pinterest

Share This