From a82a9d034b4f23086e757b5342232df716315c3a Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 17 Jun 2014 14:00:40 +0800 Subject: [PATCH] fix for tintColor property bug. fix https://github.com/xhzengAIB/XHRefreshControl/issues/3 --- RefreshControl/XHActivityIndicatorView.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RefreshControl/XHActivityIndicatorView.m b/RefreshControl/XHActivityIndicatorView.m index ac58620..14865c9 100644 --- a/RefreshControl/XHActivityIndicatorView.m +++ b/RefreshControl/XHActivityIndicatorView.m @@ -16,6 +16,7 @@ @interface XHActivityIndicatorView () @property (nonatomic, strong) CALayer *animationLayer; @property (nonatomic, strong) NSMutableArray *standbyLayersArray; +@property (nonatomic, strong) NSMutableArray *animationLayerArray; @property (nonatomic, assign) BOOL isRotating; @@ -25,6 +26,7 @@ @implementation XHActivityIndicatorView - (void)setup { self.standbyLayersArray = [[NSMutableArray alloc] init]; + self.animationLayerArray = [[NSMutableArray alloc] init]; self.isRotating = NO; @@ -63,6 +65,10 @@ - (void)setTintColor:(UIColor *)tintColor { for (CALayer *layer in self.standbyLayersArray) { layer.backgroundColor = tintColor.CGColor; } + + for (CALayer *layer in self.animationLayerArray) { + layer.backgroundColor = tintColor.CGColor; + } } - (void)setTimeOffset:(CGFloat)timeOffset { @@ -127,6 +133,8 @@ - (void)createAnimationLayers { [layer addAnimation:animation forKey:[NSString stringWithFormat:@"key %d", i]]; [self.animationLayer addSublayer:layer]; + + [self.animationLayerArray addObject:layer]; } }