iOS 使用collectionView的无限轮播图

ScrollBanner

使用collectionView制作的无限轮播图,
GitHub:https://github.com/Super-lying/LyScrollBanner
code4app:http://code4app.com/thread-9659-1-1.html

简单使用方法


    CGRect  rect = CGRectMake(0, 0, 320, 220);
    NSArray *arr = @[@"1.jpg",@"2.jpg",@"3.jpg",@"4.jpg",@"5.jpg"];
    LyScrollBanner *ScrollBanner = [LyScrollBanner LyScrollBannerWithFrame:rect
                                                                 ImagesArray:arr];
    ScrollBanner.delegate = self;
    [self.view addSubview:ScrollBanner];
  

代理方法点击获取序号

-(void)LyScrollBannerViewClickTag:(NSInteger)tag;
ScreenFlow.gif

.h 头文件

#import 

@protocol LyScrollBannerDelegate 

//@optional
-(void)LyScrollBannerViewClickTag:(NSInteger)tag;

@end

@interface LyScrollBanner : UIView
/**
 *  初始化方法1 - dataSource为url的数组
 */
+(instancetype)LyScrollBannerWithFrame:(CGRect)frame
            ImagesArrayWtithNetworking:(NSArray*)dataSource
                  placeholderImageName:(NSString *)placeholderImageName;

/**
 *  初始化方法2 - dataSource为本地imageName的数组
 */
+(instancetype)LyScrollBannerWithFrame:(CGRect)frame
                        ImageNameArray:(NSArray*)dataSource;

-(instancetype)initWithFrame:(CGRect)frame
             ImageNameArray:(NSArray *)dataSource;

@property(nonatomic ,assign)BOOL       isCancelAutoNextPage;//取消自动轮播
@property(nonatomic ,assign)BOOL       isCancelPageControl;//取消pagecontrol;
@property(nonatomic ,assign)BOOL       isCancelInfiniteBanner;//取消无限轮播

@property (nonatomic, weak)id  delegate;

@end

你可能感兴趣的:(iOS 使用collectionView的无限轮播图)