Is it possible to change the color of UIActivityIndicatorView while it is still animating? if anyone have had this issue, then you can suggest me
I just tried the following code in a view controller class, and it worked on iOS 5+
#import "ViewController.h"
@interface ViewController ()
@property UIActivityIndicatorView *activityIndicator;
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self.view setBackgroundColor:[UIColor clearColor]];
_activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[_activityIndicator setCenter:self.view.center];
[self.view addSubview:_activityIndicator];
[_activityIndicator startAnimating];
[NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(changeColor) userInfo:nil repeats:NO];
}
- (void)changeColor
{
_activityIndicator.color = [UIColor redColor];
}
@end
I found one Beautiful Link for you : ActivityIndicators
I think you should try : Custom Activity Indicator.
You can change the UIActivityIndicatorStyle from any of these :
UIActivityIndicatorViewStyleWhiteLarge,
UIActivityIndicatorViewStyleWhite,
UIActivityIndicatorViewStyleGray,
Hope It helps !!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With