文件名称:ios-图片轮播.zip
文件大小:3.39MB
文件格式:ZIP
更新时间:2022-07-31 13:41:31
滚动视图
当点击进入下一个页面时 你可以把图片轮播关闭 避免定时器一直开启 下面是这两个方法可以控制 /** * 停止播放 */ - (void)stop; /** * 开始播放 */ - (void)start; CGRect frame = CGRectMake(0, 100, self.view.frame.size.width, 200); NSArray *imageArr = @[@"1.jpg",@"2.png",@"3.jpg",@"4.jpg",@"1.jpg",@"2.png",@"3.jpg",@"4.jpg",@"1.jpg",@"2.png",@"3.jpg",@"4.jpg"]; CLCycleView *cycleView = [[CLCycleView alloc] initWithFrame:frame duration:3 imageArr:imageArr]; cycleView.delegate = self; cycleView.currentPageIndicatorTintColor = [UIColor redColor]; cycleView.pageIndicatorTintColor = [UIColor blueColor]; cycleView.diameter = 20; cycleView.cycleView = ^(NSInteger indexPage) { NSLog(@"block显示点击%ld张图片",indexPage); }; self.cycleView = cycleView; [self.view addSubview:cycleView]; // 或者用代理方法控制点击的某张图片 CGRect frame = CGRectMake(0, 100, self.view.frame.size.width, 200); NSArray *imageArr = @[@"1.jpg",@"2.png",@"3.jpg",@"4.jpg",@"1.jpg",@"2.png",@"3.jpg",@"4.jpg",@"1.jpg",@"2.png",@"3.jpg",@"4.jpg"]; CLCycleView *cycleView = [[CLCycleView alloc] initWithFrame:frame duration:3 imageArr:imageArr]; cycleView.delegate = self; cycleView.currentPageIndicatorTintColor = [UIColor redColor]; cycleView.pageIndicatorTintColor = [UIColor blueColor]; cycleView.diameter = 20; cycleView.cycleView = ^(NSInteger indexPage) { NSLog(@"block显示点击%ld张图片",indexPage); }; self.cycleView = cycleView; [self.view addSubview:cycleView];
【文件预览】:
图片轮播
----.git()
--------index(3KB)
--------hooks()
--------config(144B)
--------description(73B)
--------refs()
--------logs()
--------objects()
--------info()
--------COMMIT_EDITMSG(15B)
--------HEAD(23B)
----.DS_Store(6KB)
----图片轮播.xcodeproj()
--------project.xcworkspace()
--------project.pbxproj(16KB)
--------xcuserdata()
----图片轮播()
--------Assets.xcassets()
--------main.m(341B)
--------CLCycleView()
--------1.jpg(218KB)
--------3.jpg(187KB)
--------AppDelegate.h(284B)
--------AppDelegate.m(2KB)
--------Base.lproj()
--------.DS_Store(6KB)
--------IMG_0170.PNG(495KB)
--------4.jpg(333KB)
--------IMG_0171.PNG(229KB)
--------IMG_0177.PNG(36KB)
--------ViewController.h(222B)
--------2.png(188KB)
--------Info.plist(1KB)
--------ViewController.m(2KB)