SNBannerView 無限循環滾動輪播圖 集成簡單 高效

SNBannerView

代碼詳情見github, 歡迎stargit

一個實用高效的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/github

相關文章
相關標籤/搜索