UIActivityIndicatorView Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/UIKit.framework |
| Availability | Available in iOS 2.0 and later. |
| Declared in | UIActivityIndicatorView.h |
Overview
Use an activity indicator to show that a task is in progress. An activity indicator appears as a “gear” that is either spinning or stopped.
You control when an activity indicator animates by calling the startAnimating and stopAnimating methods. To automatically hide the activity indicator when animation stops, set the hidesWhenStopped property to YES.
Starting in iOS 5.0, you can set the color of the activity indicator by using the color property.
Tasks
Initializing an Activity Indicator
Managing an Activity Indicator
Configuring the Activity Indicator Appearance
-
activityIndicatorViewStyleproperty -
colorproperty
Properties
activityIndicatorViewStyle
The basic appearance of the activity indicator.
Discussion
See UIActivityIndicatorStyle for the available styles. The default value is UIActivityIndicatorViewStyleWhite.
Availability
- Available in iOS 2.0 and later.
Declared In
UIActivityIndicatorView.hcolor
The color of the activity indicator.
Discussion
If you set a color for an activity indicator, it overrides the color provided by the activityIndicatorViewStyle property.
Availability
- Available in iOS 5.0 and later.
Declared In
UIActivityIndicatorView.hhidesWhenStopped
A Boolean value that controls whether the receiver is hidden when the animation is stopped.
Discussion
If the value of this property is YES (the default), the receiver sets its hidden property (UIView) to YES when receiver is not animating. If the hidesWhenStopped property is NO, the receiver is not hidden when animation stops. You stop an animating progress indicator with the stopAnimating method.
Availability
- Available in iOS 2.0 and later.
Declared In
UIActivityIndicatorView.hInstance Methods
initWithActivityIndicatorStyle:
Initializes and returns an activity-indicator object.
Parameters
- style
A constant that specifies the style of the object to be created. See
UIActivityIndicatorStylefor descriptions of the style constants.
Return Value
An initialized UIActivityIndicatorView object or nil if the object couldn’t be created.
Discussion
UIActivityIndicatorView sizes the returned instance according to the specified style. You can set and retrieve the style of a activity indicator through the activityIndicatorViewStyle property.
Availability
- Available in iOS 2.0 and later.
Declared In
UIActivityIndicatorView.hisAnimating
Returns whether the receiver is animating.
Return Value
YES if the receiver is animating, otherwise NO.
Availability
- Available in iOS 2.0 and later.
See Also
Declared In
UIActivityIndicatorView.hstartAnimating
Starts the animation of the progress indicator.
Discussion
When the progress indicator is animated, the gear spins to indicate indeterminate progress. The indicator is animated until stopAnimating is called.
Availability
- Available in iOS 2.0 and later.
Declared In
UIActivityIndicatorView.hstopAnimating
Stops the animation of the progress indicator.
Discussion
Call this method to stop the animation of the progress indicator started with a call to startAnimating. When animating is stopped, the indicator is hidden, unless hidesWhenStopped is NO.
Availability
- Available in iOS 2.0 and later.
Declared In
UIActivityIndicatorView.hConstants
UIActivityIndicatorStyle
The visual style of the progress indicator.
typedef enum {
UIActivityIndicatorViewStyleWhiteLarge,
UIActivityIndicatorViewStyleWhite,
UIActivityIndicatorViewStyleGray,
} UIActivityIndicatorViewStyle;
Constants
UIActivityIndicatorViewStyleWhiteLargeThe large white style of indicator.
Available in iOS 2.0 and later.
Declared in
UIActivityIndicatorView.h.UIActivityIndicatorViewStyleWhiteThe standard white style of indicator (the default).
Available in iOS 2.0 and later.
Declared in
UIActivityIndicatorView.h.UIActivityIndicatorViewStyleGrayThe standard gray style of indicator.
Available in iOS 2.0 and later.
Declared in
UIActivityIndicatorView.h.
Discussion
You set the value of the activityIndicatorViewStyle property with these constants.
Availability
- Available in iOS 2.0 and later.
Declared In
UIActivityIndicatorView.h© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-10-12)