Reputation: 955
The activity indicator isn't hiding when the web page has finished loading. Here is my
.h file
@interface PropertyViewController : UIViewController{
IBOutlet UIWebView *propertyNexusHome;
IBOutlet UIActivityIndicatorView *wheel;
NSTimer *timer;
}
.m file
- (void)viewDidLoad
{
[super viewDidLoad];
[property loadRequest:[NSURLRequest requestWithURL:
[NSURL URLWithString:@"http://www.google.com"]]];
[property addSubview:wheel];
timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0)
target:self
selector:@selector(loading)
userInfo:nil
repeats:YES];
// Do any additional setup after loading the view, typically from a nib.
}
-(void)loading {
if (!property.loading)
[wheel stopAnimating];
else
[wheel startAnimating];
}
@end
Im not sure why its not disappearing, how ever it does stop spinning when the page has loaded.
Thanks in advance.
Upvotes: 4
Views: 3937
Reputation: 640
Another option would be to set [wheel setHidesWhenStopped:YES]
when you create the Activity Indicator.
Upvotes: 10
Reputation: 6918
You have to add:
wheel.hidden = YES;
when it stops animating
Upvotes: 0