TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | May 2017 |
Maintained by sunshineLixun.
Depends on: | |
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);
}