iOS图片、文字轮播器
Git/SDCycleScrollView
滚动轮播图片、文字、可使用本地图片或加载网络图片。
轮播图简单实用
需要在项目中:pod 'SDCycleScrollView'
在使用的地方:#import "SDCycleScrollView.h"
由于该库中图片处理采用了SDWebImage,所以需要导入第三方库SDWebImage。
SDCycleScrollView *cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(24, 14, kSCREEN_WIDTH - 48 , (kSCREEN_WIDTH - 48) / 327 * 160) delegate:self placeholderImage:[UIImage imageNamed:@"placeholder"]];
cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter;
cycleScrollView.currentPageDotColor = [UIColor whiteColor];
cycleScrollView.autoScrollTimeInterval = 5;
cycleScrollView.currentPageDotColor = [UIColor ZHBlueColor];
cycleScrollView.pageDotColor = [UIColor whiteColor];
cycleScrollView.layer.masksToBounds = YES;
cycleScrollView.layer.cornerRadius = 4;
[self.view addSubview:cycleScrollView];
/** 调用本地图片 */
cysleScrollView.localizationImageNamesGroup = @[[UIImage imageNamed:@"pkRukou"],[UIImage imageNamed:@"extendedPracticel"],[UIImage imageNamed:@"A-Z"]];
/** 调用Url图片数组 */
cycleScrollView.imageURLStringsGroup = imagesURLStrings;
/** 点击图片回调 */
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
}
/** 图片滚动回调 */
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index {
}
http://blog.sina.com.cn/s/blog_1531416a30102xr4y.html
https://blog.csdn.net/weixin_35755389/article/details/53217768
网友评论