CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.

YMCycleBannerImage 1.3.8

YMCycleBannerImage 1.3.8

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release May 2016

Maintained by zhaoyimin.



  • By
  • zhaoyimin
  • 一行代码搞定手动与自动无限轮播,史上最强超级无限轮播iOS框架
  • 前提条件:对应的数据模型类和对应的属性key值
  • 必选参数:frame、代理控制器、本地模型数组或者网络模型数组、自动轮播时间间隔、与对应的图片key值、占位图片路径
  • 可选参数:标题key值(nil为不设置蒙版)、是否隐藏分页指示器(YES为隐藏)
  • 协议:YMCycleBannerViewDelegate 代理方法(将选中的数组下标直接传出来了):ymCycleBannerView:didSelectItemAtIndex:
  • 框架特点:性能超强、混合无瑕疵、使用超简单,一行代码搞定,轮播流畅度AppStore无敌

GitHub:iosdeveloperSVIP     邮箱:[email protected]

亲爱的各位同行,如果在使用中出现bug,请联系邮箱: [email protected],如果使用不错的话请帮我点下右上角星星Star,非常感谢

操作目录


安装使用

手动导入文件

  • 将YMCycleBannerImage文件夹中的所有源代码拽入项目中
  • 【导入主头文件:#import "YMCycleBannerView.h"

默认样式:apple官方磨砂蒙版效果

YMCycleBannerView *bannerView = [[YMCycleBannerView alloc]

initWithFrame:CGRectMake(0, [UIScreen mainScreen].bounds.size.width * 0.5,
[UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.width * 0.5)
Delegate:self banners:bannerModel2 duration:2.0
ImageUrlKeyPath:@"ymbanner" placeholder:nil
titleKeyPath:@"title" hiddenPage:NO];
//参数解析:initWithFrame(轮播视图的大小和位置) Delegate(传入代理控制器) banners(数据模型数组)
//duration(轮播时间间隔) ImageUrlKeyPath(图片url的模型key值) placeholder(本地占位图片路径)
//titleKeyPath(标题栏的模型key值) hiddenPage(是否隐藏分页指示器)
[self.view addSubview:bannerView];
YMCycleBannerViewDelegate //请遵守协议
-(void)ymCycleBannerView:(YMCycleBannerView *)ymCycleBannerView didSelectItemAtIndex:(NSInteger)index
//请实现代理方法、index为选中的数组下标,做控制器跳转操作

自定义蒙版

bannerView.ym_maskView.backgroundColor = [UIColor blackColor];//设置背景颜色

bannerView.ym_maskView.alpha = 0.5;//设置透明度
//其它扩展属性:frame、hidden

自定标题栏

bannerView.ym_titleLabel.font = [UIFont systemFontOfSize:20.0];//设置标题的字体大小

bannerView.ym_titleLabel.textColor = [UIColor redColor];//设置标题的字体颜色
//其它扩展属性:frame、hidden

自定分页指示器

//自定义分页指示器图标

bannerView.ym_currentPageImage = [UIImage imageNamed:@"图片路径"];
bannerView.ym_pageImage = [UIImage imageNamed:@"图片路径"];
//使用apple官方分页指示器颜色图标
bannerView.ym_currentPageIndicatorTintColor = [UIColor redColor];
bannerView.ym_pageIndicatorTintColor = [UIColor whiteColor];
//其它扩展属性:frame,如需设置隐藏请设置初始化参数hiddenPage为YES

亲爱的各位同行,如果你已经浏览到这,请帮我点下右上角星星Star,非常感谢