Skip to content

Mag1cPanda/LRCycleScrollViewDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

安装

  1. 在项目中导入SDWebImage
  2. LRCycleScrollView文件夹拖入到项目中
  3. 导入 "LRCycleScrollView.h"

使用

LRCycleScrollView *cycleScrollView = [LRCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 20, self.view.frame.size.width, 200)         placeholderImage:[UIImage imageNamed:@"slide_img"]];
cycleScrollView.delegate = self;
cycleScrollView.pageControlStyle = LRPageContolStyleAnimated;
cycleScrollView.currentPageDotImage = [UIImage imageNamed:@"slide_navon"];
cycleScrollView.pageDotImage = [UIImage imageNamed:@"slide_nav"];
cycleScrollView.pageControlBottomOffset = 30;
cycleScrollView.infiniteLoop = YES;
cycleScrollView.autoScrollTimeInterval = 3.0;
//block回调
cycleScrollView.scrollHandle = ^(NSInteger index){
    NSLog(@"Scroll to index ~ %zi",index);
};

cycleScrollView.clickHandle = ^(NSInteger index){
    NSLog(@"Click index ~ %zi",index);
};

[self.view addSubview:cycleScrollView];

//设置本地图
cycleScrollView.localImageNamesGroup = @[@"slide_img",@"slide_img",@"slide_img"];

//设置网络图片
NSArray *imgURLArr = @[@"http://p1.bqimg.com/567571/bb20a661a0210133.jpg",
                       @"http://p1.bqimg.com/567571/d159dd39c15025ce.jpg",
                       @"http://p1.bpimg.com/567571/1a105a4f6ab5f7ce.jpg",
                       @"http://p1.bpimg.com/567571/f289c6248725d93b.jpg",
                       @"http://p1.bpimg.com/567571/7fffbfba12359c0b.jpg",
                       @"http://p1.bqimg.com/567571/ccb99ecef6f67ba0.jpg"];

cycleScrollView.imageURLStringsGroup = imgURLArr;

//设置标题
cycleScrollView.titlesGroup = @[@"http://p1.bqimg.com/567571/bb20a661a0210133.jpg",
                                @"http://p1.bqimg.com/567571/d159dd39c15025ce.jpg",
                                @"http://p1.bpimg.com/567571/1a105a4f6ab5f7ce.jpg",
                                @"http://p1.bpimg.com/567571/f289c6248725d93b.jpg",
                                @"http://p1.bpimg.com/567571/7fffbfba12359c0b.jpg",
                                @"http://p1.bqimg.com/567571/ccb99ecef6f67ba0.jpg"];
   

//代理回调
-(void)cycleScrollView:(LRCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index
{
    NSLog(@"Scroll to index ~ %zi",index);
}

-(void)cycleScrollView:(LRCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index
{
    NSLog(@"Click index ~ %zi",index);
}

其他API请在"LRCycleScrollView.h"文件中查看

About

循环广告页

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published