Fixed issue #1

This commit is contained in:
Looping 2015-03-09 17:42:26 +08:00
parent 483e72cdfc
commit 262ff55d3d
1 changed files with 13 additions and 0 deletions

View File

@ -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];