测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | MIT |
发布上次发布 | 2017年5月 |
由 sunshineLixun 维护。
依赖 | |
YYWebImage | >= 0 |
YYCategories | >= 0 |
一款实现无限轮播的开源库,目前支持纯图片轮播,并且支持 GIF 动图,陆续会增加纯文字轮播,图片加文字轮播。项目中使用 YYWebImage 来代替图片的加载和缓存,YYCategories 用来做图片的缓存清理,下载该项目会默认下载 YYWebImage 和 YYCategories。
LXCycleView *cycleView = [[LXCycleView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 300) images:@[@"http://www.macitup.com.au/wp-content/uploads/2014/07/apple-mac.jpg",@"http://www.secondbyte.co.uk/ekmps/shops/xelec/resources/Design/mini-27.jpg",@"http://www.cyansolutions.co.uk/wp-content/uploads/2013/10/Apple-Mac-Support-Hampshire.jpg",@"https://d13yacurqjgara.cloudfront.net/users/345826/screenshots/1780193/dots18.gif"] placeholder:nil];
cycleView.delegate = self;
cycleView.currentPageIndicatorTintColor = [UIColor redColor];
cycleView.pageIndicatorTintColor = [UIColor whiteColor];
可以不用指定的初始化方法创建一个banner 但必须设置weImages 并且不能为空。 可传入UIIiamge或者URL
//cycleView.webImages = @[@"http://www.macitup.com.au/wp-content/uploads/2014/07/apple-mac.jpg",@"http://www.secondbyte.co.uk/ekmps/shops/xelec/resources/Design/mini-27.jpg"];
[cycleView setDidSelectedBlock:^(NSInteger index){
NSLog(@"%ld",index);
}];
[self.view addSubview:cycleView];
//代理方法
- (void)didSelectItemAtIndex:(NSInteger)index{
NSLog(@"%ld",index);
}