From 262ff55d3de3b978249b71d5d1eb98fce75d5429 Mon Sep 17 00:00:00 2001 From: Looping Date: Mon, 9 Mar 2015 17:42:26 +0800 Subject: [PATCH] Fixed issue #1 --- RCPageControl/RCPageControl.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/RCPageControl/RCPageControl.m b/RCPageControl/RCPageControl.m index f0bf4bc..4d94ba9 100644 --- a/RCPageControl/RCPageControl.m +++ b/RCPageControl/RCPageControl.m @@ -407,8 +407,21 @@ for (; index < _numberOfPages; index ++) { CGRect frame = CGRectMake(position.x + index * (_indicatorDotGap + _indicatorDotWidth), position.y, _indicatorDotWidth, _indicatorDotWidth); UIView *dot = [self _dotAtIndex:index] ?: [[UIView alloc] initWithFrame:frame]; + + if ([UIView respondsToSelector:@selector(performWithoutAnimation:)]) { + [UIView performWithoutAnimation:^{ + [dot setTransform:CGAffineTransformIdentity]; + }]; + } else { + BOOL reenableAnimations = [UIView areAnimationsEnabled]; + [UIView setAnimationsEnabled:NO]; + [dot setTransform:CGAffineTransformIdentity]; + [UIView setAnimationsEnabled:reenableAnimations]; + } + [dot setTag:[self _dotTagAtIndex:index]]; [dot setBackgroundColor:_pageIndicatorTintColor]; + [dot.layer setMasksToBounds:YES]; [dot.layer setCornerRadius:dot.frame.size.height / 2];