In my application i load at startup the distance between user location and a known point; I want to show at startup an activity indicator with a label "Loading" that then disappears to show the distance. How can I do?
+1
A:
If you build your views programmatically then this is how you instantiate the activity indicator view:
UIActivityIndicatorView *activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
If you use the IB then it is exactly like adding any other view...
In order to start animating use the [activityIndicatorView startAnimating];
method.
In order to stop - use the [activityIndicatorView stopAnimating];
.
In order to hide the label and the activity indicator together just put the inside an additional view (it might be full-screen half transparent view) and show/hide this view instead of label and indicator view separately.
This way you will also disable all the touchable UI elements (actually, you will hide these by the half-transparent loading view).
Michael Kessler
2010-07-09 11:54:54
i have another idea, i set [indicator startAnimating] in viewDidLoad e then i set [indicator stopUpdating] in method that update the geographic location before distanceShow.text = [NSString stringWithFormat:@"%0.f",distance];and works!!;)
Claudio
2010-07-09 12:25:45