From 7092f09c04c9ea85aa0b07666830ab27df695e27 Mon Sep 17 00:00:00 2001 From: zxwcool Date: Sun, 27 Dec 2015 22:38:21 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E6=95=B0=E7=BB=84=E5=92=8CNSURL=E6=95=B0=E7=BB=84?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0reloadImage=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 支持字符串数组和NSURL数组初始化,增加- (void)reloadImageURLArray:(NSArray*)URLarr方法,重新设置图片链接数组,刷新显示图片(适用于上下拉刷新后,重新设置图片数组,更新图片) --- AdView/AdView/AdView/AdView.m | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/AdView/AdView/AdView/AdView.m b/AdView/AdView/AdView/AdView.m index bd78000..106e043 100755 --- a/AdView/AdView/AdView/AdView.m +++ b/AdView/AdView/AdView/AdView.m @@ -143,8 +143,13 @@ + (id)adScrollViewWithFrame:(CGRect)frame imageLinkURL:(NSArray *)imageLinkURL p NSMutableArray * imagePaths = [[NSMutableArray alloc]init]; for (NSString * imageName in imageLinkURL) { - NSURL * imageURL = [NSURL URLWithString:imageName]; - [imagePaths addObject:imageURL]; + //支持字符串数组和NSURL数组 + if ([imageName isKindOfClass:[NSString class]]) { + NSURL * imageURL = [NSURL URLWithString:imageName]; + [imagePaths addObject:imageURL]; + }else if ([imageName isKindOfClass:[NSURL class]]){ + [imagePaths addObject:imageName]; + } } AdView * adView = [AdView adScrollViewWithFrame:frame imageLinkURL:imageLinkURL pageControlShowStyle:PageControlShowStyle]; adView.placeHoldImage = [UIImage imageNamed:imageName]; @@ -216,7 +221,10 @@ - (void)setImageLinkURL:(NSArray *)imageLinkURL [self setPageControlShowStyle:self.PageControlShowStyle]; } - +#pragma mark - 重新设置图片链接数组,刷新显示图片(适用于上下拉刷新后,重新设置图片数组,更新图片) +- (void)reloadImageURLArray:(NSArray*)URLarr{ + [self setImageLinkURL:URLarr]; +} #pragma mark - 设置每个对应广告对应的广告语 - (void)setAdTitleArray:(NSArray *)adTitleArray withShowStyle:(AdTitleShowStyle)adTitleStyle @@ -405,4 +413,4 @@ -(void)tap _callBackForModel(self.models[centerImageIndex]); } } -@end \ No newline at end of file +@end From 00ab819aac4fedde5e042004bd58003af594e336 Mon Sep 17 00:00:00 2001 From: zxwcool Date: Sun, 27 Dec 2015 22:39:50 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E5=A2=9E=E5=8A=A0reloadImageURLArray?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加reloadImageURLArray方法声明 --- AdView/AdView/AdView/AdView.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AdView/AdView/AdView/AdView.h b/AdView/AdView/AdView/AdView.h index a483613..887e588 100755 --- a/AdView/AdView/AdView/AdView.h +++ b/AdView/AdView/AdView/AdView.h @@ -148,4 +148,10 @@ typedef NS_ENUM(NSUInteger, AdTitleShowStyle) * @param imageName 属性名称 */ + (id)adScrollViewWithFrame:(CGRect)frame modelArr:(NSArray *)modelArr imagePropertyName:(NSString *)imageName pageControlShowStyle:(UIPageControlShowStyle)PageControlShowStyle; +/** + * 重新设置图片链接数组,刷新显示图片 + * + * @param URLarr 新的URL数组 + */ +- (void)reloadImageURLArray:(NSArray*)URLarr; @end From ede82dcb716422b25f6cc3d7fb469c4d2372bab4 Mon Sep 17 00:00:00 2001 From: zxwcool Date: Mon, 28 Dec 2015 14:06:08 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=96=B9=E5=BC=8F=08=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 可以设置图片展示方式,增加枚举属性 --- AdView/AdView/AdView/AdView.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/AdView/AdView/AdView/AdView.h b/AdView/AdView/AdView/AdView.h index 887e588..1c50c1d 100755 --- a/AdView/AdView/AdView/AdView.h +++ b/AdView/AdView/AdView/AdView.h @@ -33,6 +33,19 @@ typedef NS_ENUM(NSUInteger, AdTitleShowStyle) AdTitleShowStyleRight, }; +typedef NS_ENUM(NSUInteger, AdPictureShowStyle) +{ + /** + * @author ZY, 15-04-26 + * + * 图片显示方式 + */ + AdPictureShowModeScaleToFill, + AdPictureShowModeScaleAspectFit, // contents scaled to fit with fixed aspect. remainder is transparent + AdPictureShowModeScaleAspectFill, // contents scaled to fill with fixed aspect. some portion of content may be clipped. + AdPictureShowModeCenter, +}; + @interface AdView : UIView { UILabel * _centerAdLabel; @@ -58,7 +71,12 @@ typedef NS_ENUM(NSUInteger, AdTitleShowStyle) * 设置标题对应的位置 */ @property (assign,nonatomic,readonly) AdTitleShowStyle adTitleStyle; - +/** + * @author ZY, 15-05-17 + * + * 图片显示方式 + */ +@property (assign,nonatomic) AdPictureShowStyle pictureShowStyle; /** * @author ZY, 15-05-17 * From c631e407deabe093c563ae7d44d1c9cba4066660 Mon Sep 17 00:00:00 2001 From: zxwcool Date: Mon, 28 Dec 2015 14:09:05 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=B1=95=E7=A4=BA=E7=BC=A9=E6=94=BE=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E5=B1=9E=E6=80=A7=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加设置图片展示缩放方式属性方法 --- AdView/AdView/AdView/AdView.m | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/AdView/AdView/AdView/AdView.m b/AdView/AdView/AdView/AdView.m index 106e043..fd440a7 100755 --- a/AdView/AdView/AdView/AdView.m +++ b/AdView/AdView/AdView/AdView.m @@ -310,7 +310,33 @@ - (void)setPageControlShowStyle:(UIPageControlShowStyle)PageControlShowStyle _pageControl.enabled = NO; [self addSubview:_pageControl]; } - +#pragma mark - 设置图片展示缩放方式 +- (void)setPictureShowStyle:(AdPictureShowStyle)pictureShowStyle{ + switch (pictureShowStyle) { + case AdPictureShowModeScaleToFill: + _leftImageView.contentMode = UIViewContentModeScaleToFill; + _centerImageView.contentMode = UIViewContentModeScaleToFill; + _rightImageView.contentMode = UIViewContentModeScaleToFill; + break; + case AdPictureShowModeScaleAspectFit: + _leftImageView.contentMode = UIViewContentModeScaleAspectFit; + _centerImageView.contentMode = UIViewContentModeScaleAspectFit; + _rightImageView.contentMode = UIViewContentModeScaleAspectFit; + break; + case AdPictureShowModeScaleAspectFill: + _leftImageView.contentMode = UIViewContentModeScaleAspectFill; + _centerImageView.contentMode = UIViewContentModeScaleAspectFill; + _rightImageView.contentMode = UIViewContentModeScaleAspectFill; + break; + case AdPictureShowModeCenter: + _leftImageView.contentMode = UIViewContentModeCenter; + _centerImageView.contentMode = UIViewContentModeCenter; + _rightImageView.contentMode = UIViewContentModeCenter; + break; + default: + break; + } +} #pragma mark - 计时器到时,系统滚动图片 - (void)animalMoveImage:(NSTimer *)time { From 87469936f47b00c706ec7db2c6fb5e94ff669264 Mon Sep 17 00:00:00 2001 From: zxwcool Date: Mon, 28 Dec 2015 14:28:38 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E5=A2=9E=E5=8A=A0pageControl=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=81=8F=E7=A7=BB=E9=87=8F=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 可以在原有显示位置上进行位置的微调,通过UIEdgeInsets调节 --- AdView/AdView/AdView/AdView.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AdView/AdView/AdView/AdView.h b/AdView/AdView/AdView/AdView.h index 1c50c1d..cf42082 100755 --- a/AdView/AdView/AdView/AdView.h +++ b/AdView/AdView/AdView/AdView.h @@ -65,6 +65,12 @@ typedef NS_ENUM(NSUInteger, AdPictureShowStyle) * 设置page显示位置 */ @property (assign,nonatomic) UIPageControlShowStyle PageControlShowStyle; +/** + * @author ZY, 15-05-17 + * + * pageControl显示偏移量 + */ +@property (assign,nonatomic) UIEdgeInsets pageControlEdgeInsets; /** * @author ZY, 15-05-17 * From ec18c6d7e2b4c01bb6eefe9a4312304e66faa5d7 Mon Sep 17 00:00:00 2001 From: zxwcool Date: Mon, 28 Dec 2015 14:30:48 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AEpageC?= =?UTF-8?q?ontrol=E5=81=8F=E7=A7=BB=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在原有显示位置,进行pageControl的位置微调 --- AdView/AdView/AdView/AdView.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AdView/AdView/AdView/AdView.m b/AdView/AdView/AdView/AdView.m index fd440a7..dbc051c 100755 --- a/AdView/AdView/AdView/AdView.m +++ b/AdView/AdView/AdView/AdView.m @@ -310,6 +310,14 @@ - (void)setPageControlShowStyle:(UIPageControlShowStyle)PageControlShowStyle _pageControl.enabled = NO; [self addSubview:_pageControl]; } +#pragma mark - 设置pageControl偏移量 +- (void)setPageControlEdgeInsets:(UIEdgeInsets)pageControlEdgeInsets{ + CGRect orgiFrame = _pageControl.frame; + orgiFrame.origin.x += pageControlEdgeInsets.left; + orgiFrame.origin.x -= pageControlEdgeInsets.right; + orgiFrame.origin.y += pageControlEdgeInsets.top; + orgiFrame.origin.y -= pageControlEdgeInsets.bottom; +} #pragma mark - 设置图片展示缩放方式 - (void)setPictureShowStyle:(AdPictureShowStyle)pictureShowStyle{ switch (pictureShowStyle) { From 634fc7983588c1f02756b87d1ef1c2caac089beb Mon Sep 17 00:00:00 2001 From: zxwcool Date: Mon, 28 Dec 2015 14:35:08 +0800 Subject: [PATCH 07/12] _pageControl.frame = orgiFrame; MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复 --- AdView/AdView/AdView/AdView.m | 1 + 1 file changed, 1 insertion(+) diff --git a/AdView/AdView/AdView/AdView.m b/AdView/AdView/AdView/AdView.m index dbc051c..f068c3f 100755 --- a/AdView/AdView/AdView/AdView.m +++ b/AdView/AdView/AdView/AdView.m @@ -317,6 +317,7 @@ - (void)setPageControlEdgeInsets:(UIEdgeInsets)pageControlEdgeInsets{ orgiFrame.origin.x -= pageControlEdgeInsets.right; orgiFrame.origin.y += pageControlEdgeInsets.top; orgiFrame.origin.y -= pageControlEdgeInsets.bottom; + _pageControl.frame = orgiFrame; } #pragma mark - 设置图片展示缩放方式 - (void)setPictureShowStyle:(AdPictureShowStyle)pictureShowStyle{ From b90404ff8db3cbb2f81641d7c2bab4a28fa0d202 Mon Sep 17 00:00:00 2001 From: zxwcool Date: Wed, 30 Dec 2015 21:19:28 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E5=A4=96=E9=83=A8=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=BB=9A=E5=8A=A8=E5=BC=80=E5=A7=8B=E5=81=9C?= =?UTF-8?q?=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 外部控制自动滚动开始停止 --- AdView/AdView/AdView/AdView.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AdView/AdView/AdView/AdView.h b/AdView/AdView/AdView/AdView.h index cf42082..ad953b1 100755 --- a/AdView/AdView/AdView/AdView.h +++ b/AdView/AdView/AdView/AdView.h @@ -178,4 +178,10 @@ typedef NS_ENUM(NSUInteger, AdPictureShowStyle) * @param URLarr 新的URL数组 */ - (void)reloadImageURLArray:(NSArray*)URLarr; +/** + * 停止/开始自动滚屏 + * + * @param URLarr 新的URL数组 + */ +- (void)stopAutoScroll:(BOOL)stop; @end From 1cd6dafb6f2c460364ffe450a3384d06a1abf69c Mon Sep 17 00:00:00 2001 From: zxwcool Date: Wed, 30 Dec 2015 21:20:18 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E5=A4=96=E9=83=A8=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=BB=9A=E5=8A=A8=E5=BC=80=E5=A7=8B=E5=81=9C?= =?UTF-8?q?=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 外部控制自动滚动开始停止 --- AdView/AdView/AdView/AdView.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/AdView/AdView/AdView/AdView.m b/AdView/AdView/AdView/AdView.m index f068c3f..dc883af 100755 --- a/AdView/AdView/AdView/AdView.m +++ b/AdView/AdView/AdView/AdView.m @@ -353,7 +353,16 @@ - (void)animalMoveImage:(NSTimer *)time _isTimeUp = YES; [NSTimer scheduledTimerWithTimeInterval:0.4f target:self selector:@selector(scrollViewDidEndDecelerating:) userInfo:nil repeats:NO]; } - +#pragma mark 停止/开始自动滚屏 +- (void)stopAutoScroll:(BOOL)stop +{ + if (!stop){ + [self setUpTime]; + }else{ + [moveTimer invalidate]; + moveTimer = nil; + } +} #pragma mark - 图片停止时,调用该函数使得滚动视图复用 - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { From ea6ff31d8e0b5dfc4c1e57a03dffeb9c9a86035e Mon Sep 17 00:00:00 2001 From: zxwcool Date: Wed, 30 Dec 2015 21:48:14 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BD=A2=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 测试github桌面版提交修改 --- .../UserInterfaceState.xcuserstate | Bin 0 -> 8138 bytes .../xcschemes/AdView.xcscheme | 101 ++++++++++++++++++ .../xcschemes/xcschememanagement.plist | 27 +++++ AdView/AdView/AdView/AdView.h | 2 +- AdView/AdView/AdView/AdView.m | 5 +- 5 files changed, 131 insertions(+), 4 deletions(-) create mode 100644 AdView/AdView.xcodeproj/project.xcworkspace/xcuserdata/heguoping.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 AdView/AdView.xcodeproj/xcuserdata/heguoping.xcuserdatad/xcschemes/AdView.xcscheme create mode 100644 AdView/AdView.xcodeproj/xcuserdata/heguoping.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/AdView/AdView.xcodeproj/project.xcworkspace/xcuserdata/heguoping.xcuserdatad/UserInterfaceState.xcuserstate b/AdView/AdView.xcodeproj/project.xcworkspace/xcuserdata/heguoping.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..c312c1c388f1c0f847aff59efd6bd9b7fae583c3 GIT binary patch literal 8138 zcmcIpd3;mF_Me$%x!G@SmYX87m6okry3iIxC|#ferF4O|6hfNbwt+N>NeYyL9uY)D zL_|@Ltp!;W0eL8k8}GTHfXE`a;_`U-d+0-bE>B#4b90-t;rV_)|M>mdPn(;WGv}O{ zIp=%6Gq>LFaR)=`>E{qe1jQj4k|PEA7x|%j;9MaPbo;#31AX zPornhLG&UzivEmVL&wnxbOybHE}~253i=#Q*bIy z!|B+LGjJx(!z1t*oR25qiFgt&#pSpG3%C(C;b!c{v+*44!Sit&UVz*2Lc9pyhHuBq z@jZAoei%QBH{&gM8{Ua`;V1A@ct3syAHmP!=kQv&CBsN2$s*Zg6d6Y*kxEic>c}k8Km_6@ zUJ@X4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RBpVWV$zo!35|BL=N12*UltbsF_ z4gC!XhD5_4L#iRiaFe0LP-So!oCcRcFuZ6uX1HkhtKk|;*c3K{ox%Fqb?kO_4|{}t zj(veW%D&E?V$ZQ3vLCabvX|JOjEvD}G#M>M-WYEjU>s;nG7dHlH6|OgjiZgX80(Eb z<9y=+<3i(YMldcnt}w1Nt}?DRt}#AkeAD08QTvL(h7Slvi zsj0$LWtwKHG0icBOiNAcO$SV;Os7p}O>dhnn7%SyGb6LsoMs+r9%UYF&NmmBtIf6M zI`d5PEOWhijyYtWYo2djU|wjx&Ah_A(!9#N+PulU#oTG$W`4^2C-c+hgXWjbubPjU z-!PvxUo?Mg{?vTQ{EPWF3%0~rvuT zYdvOt!+OH{CO??B^I80GK9?`z$Md)FllaN}6n-Y};sw5m_wZic&jF{G}Z{>IMhxwQIxA=GY_xTU`kN8jcEBqJyRsJjfpZvG{FE)+MYD=&s z*#_H&*-~t2wo$f1+Z0>9t-;o4Yqrg{d2C*r-xjdlX + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AdView/AdView.xcodeproj/xcuserdata/heguoping.xcuserdatad/xcschemes/xcschememanagement.plist b/AdView/AdView.xcodeproj/xcuserdata/heguoping.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..a86c9c1 --- /dev/null +++ b/AdView/AdView.xcodeproj/xcuserdata/heguoping.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + AdView.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 53E54CF91AED3CF10077D764 + + primary + + + 53E54D121AED3CF10077D764 + + primary + + + + + diff --git a/AdView/AdView/AdView/AdView.h b/AdView/AdView/AdView/AdView.h index ad953b1..128e7d1 100755 --- a/AdView/AdView/AdView/AdView.h +++ b/AdView/AdView/AdView/AdView.h @@ -183,5 +183,5 @@ typedef NS_ENUM(NSUInteger, AdPictureShowStyle) * * @param URLarr 新的URL数组 */ -- (void)stopAutoScroll:(BOOL)stop; +- (void)stopAutoScroll:(BOOL)stopOrNo; @end diff --git a/AdView/AdView/AdView/AdView.m b/AdView/AdView/AdView/AdView.m index dc883af..122a39b 100755 --- a/AdView/AdView/AdView/AdView.m +++ b/AdView/AdView/AdView/AdView.m @@ -354,9 +354,8 @@ - (void)animalMoveImage:(NSTimer *)time [NSTimer scheduledTimerWithTimeInterval:0.4f target:self selector:@selector(scrollViewDidEndDecelerating:) userInfo:nil repeats:NO]; } #pragma mark 停止/开始自动滚屏 -- (void)stopAutoScroll:(BOOL)stop -{ - if (!stop){ +- (void)stopAutoScroll:(BOOL)stopOrNo{ + if (!stopOrNo){ [self setUpTime]; }else{ [moveTimer invalidate]; From 0e7ba79d0534efbe7d2980d989aacb654b537acc Mon Sep 17 00:00:00 2001 From: zxwcool Date: Wed, 30 Dec 2015 22:06:48 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=81=9C=E6=AD=A2=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 改为暂停和继续,避免重置定时器计时,导致时间间隔重置 --- AdView/AdView/AdView/AdView.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/AdView/AdView/AdView/AdView.m b/AdView/AdView/AdView/AdView.m index 122a39b..59b3224 100755 --- a/AdView/AdView/AdView/AdView.m +++ b/AdView/AdView/AdView/AdView.m @@ -356,10 +356,9 @@ - (void)animalMoveImage:(NSTimer *)time #pragma mark 停止/开始自动滚屏 - (void)stopAutoScroll:(BOOL)stopOrNo{ if (!stopOrNo){ - [self setUpTime]; + [moveTimer setFireDate:[NSDate distantPast]]; }else{ - [moveTimer invalidate]; - moveTimer = nil; + [moveTimer setFireDate:[NSDate distantFuture]]; } } #pragma mark - 图片停止时,调用该函数使得滚动视图复用 From a42a1dc1947589a16345e50de8429a2ed9c871c5 Mon Sep 17 00:00:00 2001 From: zxwcool Date: Thu, 31 Dec 2015 16:57:14 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=9C=A8=E7=88=B6?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E9=87=8D=E8=BD=BD=E6=97=B6=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E8=B0=83=E7=94=A8willMoveToSuperview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 避免在父视图重载时,重复调用willMoveToSuperview,重定义定时器事件,造成定时器不断累加,滚动加快 --- AdView/AdView/AdView/AdView.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/AdView/AdView/AdView/AdView.m b/AdView/AdView/AdView/AdView.m index 59b3224..8534318 100755 --- a/AdView/AdView/AdView/AdView.m +++ b/AdView/AdView/AdView/AdView.m @@ -101,14 +101,18 @@ - (void)willMoveToSuperview:(UIView *)newSuperview [self setUpTime]; } } - +//避免在父视图重载时,重复调用willMoveToSuperview,重定义定时器事件,造成定时器不断累加,滚动加快 - (void)setUpTime { - if (_isNeedCycleRoll&&_imageLinkURL.count>=2) + if (_isNeedCycleRoll && _imageLinkURL.count>=2 && !moveTimer) { moveTimer = [NSTimer scheduledTimerWithTimeInterval:_adMoveTime target:self selector:@selector(animalMoveImage:) userInfo:nil repeats:YES]; _isTimeUp = NO; } + else if(_isNeedCycleRoll && _imageLinkURL.count>=2 && moveTimer) + { + [self stopAutoScroll:NO]; + } } - (void)setIsNeedCycleRoll:(BOOL)isNeedCycleRoll