美文网首页
常用三方 SDCycleScrollView轮播图

常用三方 SDCycleScrollView轮播图

作者: 求长生 | 来源:发表于2020-05-27 16:47 被阅读0次

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

https://www.jianshu.com/p/641403879f7b

相关文章

网友评论

      本文标题:常用三方 SDCycleScrollView轮播图

      本文链接:https://www.haomeiwen.com/subject/uzepwctx.html