SNBannerView 无限循环滚动轮播图 集成简单 高效

ⅰ亾dé卋堺 提交于 2019-12-06 16:18:13

SNBannerView

代码详情见github, 欢迎star

一个实用高效的bannerView,集成简单,无限滚动 支持CocoaPods

示例1示例2

示例/用法

delegate(optional)
- (void)bannerView:(SNBannerView *)bannerView didSelectImageIndex:(NSInteger)index;
block(optional)
@property (nonatomic, copy) SNBannerViewSelectImageBlock sn_BannerViewSelectImageBlock;
使用
// 基于本地图片
/*
 * imageNames 本地图片名称
 */
- (instancetype)initWithFrame:(CGRect)frame
                     delegate:(id<SNBannerViewDelegate>)delegate
                   imageNames:(NSArray *)imageNames
         currentPageTintColor:(UIColor *)currentPageTintColor
                pageTintColor:(UIColor *)pageTintColor;

+ (instancetype)bannerWithFrame:(CGRect)frame
                       delegate:(id<SNBannerViewDelegate>)delegate
                     imageNames:(NSArray *)imageNames
           currentPageTintColor:(UIColor *)currentPageTintColor
                  pageTintColor:(UIColor *)pageTintColor;

//基于url
/*
 * URLs 字符串url
 */
- (instancetype)initWithFrame:(CGRect)frame
                     delegate:(id<SNBannerViewDelegate>)delegate
                    imageURLs:(NSArray *)URLs
         placeholderImageName:(NSString *)placeholderImageName
         currentPageTintColor:(UIColor *)currentPageTintColor
                pageTintColor:(UIColor *)pageTintColor;

+ (instancetype)bannerWithFrame:(CGRect)frame
                       delegate:(id<SNBannerViewDelegate>)delegate
                      imageURLs:(NSArray *)URLs
           placeholderImageName:(NSString *)placeholderImageName
           currentPageTintColor:(UIColor *)currentPageTintColor
                  pageTintColor:(UIColor *)pageTintColor;

//基于 模型
/*
 * models 模型对象 URLAttributeName对应URL属性名称
 */
- (instancetype)initWithFrame:(CGRect)frame
                     delegate:(id<SNBannerViewDelegate>)delegate
                        model:(NSArray *)models
             URLAttributeName:(NSString *)URLAttributeName
         placeholderImageName:(NSString *)placeholderImageName
         currentPageTintColor:(UIColor *)currentPageTintColor
                pageTintColor:(UIColor *)pageTintColor;

+ (instancetype)bannerWithFrame:(CGRect)frame
                       delegate:(id<SNBannerViewDelegate>)delegate
                          model:(NSArray *)models
               URLAttributeName:(NSString *)URLAttributeName
           placeholderImageName:(NSString *)placeholderImageName
           currentPageTintColor:(UIColor *)currentPageTintColor
                  pageTintColor:(UIColor *)pageTintColor;

//其它用法
/*
  也可自行初始化 相关参数设置详见 .h 文件
**/

欢迎访问Blog

Blog: https://wsenos.github.io/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!