UIProgressView Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/UIKit.framework |
| Availability | Available in iOS 2.0 and later. |
| Declared in | UIProgressView.h |
Overview
You use the UIProgressView class to depict the progress of a task over time. An example of a progress bar is the one shown at the bottom of the Mail application when it’s downloading messages.
The UIProgressView class provides properties for managing the style of the progress bar and for getting and setting values that are pinned to the progress of a task.
For an indeterminate progress indicator—or, informally, a “spinner”—use an instance of the UIActivityIndicatorView class.
Tasks
Initializing the UIProgressView Object
Managing the Progress Bar
-
progressproperty -
– setProgress:animated:
Configuring the Progress Bar
-
progressViewStyleproperty -
progressTintColorproperty -
progressImageproperty -
trackTintColorproperty -
trackImageproperty
Properties
progress
The current progress shown by the receiver.
Discussion
The current progress is represented by a floating-point value between 0.0 and 1.0, inclusive, where 1.0 indicates the completion of the task. The default value is 0.0. Values less than 0.0 and greater than 1.0 are pinned to those limits.
Availability
- Available in iOS 2.0 and later.
Declared In
UIProgressView.hprogressImage
An image to use for the portion of the progress bar that is filled.
Discussion
If you provide a custom image, the progressTintColor property is ignored.
Availability
- Available in iOS 5.0 and later.
Declared In
UIProgressView.hprogressTintColor
The color shown for the portion of the progress bar that is filled.
Availability
- Available in iOS 5.0 and later.
Declared In
UIProgressView.hprogressViewStyle
The current graphical style of the receiver.
Discussion
The value of this property is a constant that specifies the style of the progress view. The default style is UIProgressViewStyleDefault. For more on these constants, see UIProgressViewStyle.
Availability
- Available in iOS 2.0 and later.
Declared In
UIProgressView.htrackImage
An image to use for the portion of the track that is not filled.
Discussion
If you provide a custom image, the trackTintColor property is ignored.
Availability
- Available in iOS 5.0 and later.
Declared In
UIProgressView.htrackTintColor
The color shown for the portion of the progress bar that is not filled.
Availability
- Available in iOS 5.0 and later.
Declared In
UIProgressView.hInstance Methods
initWithProgressViewStyle:
Initializes and returns an progress-view object.
Parameters
- style
A constant that specifies the style of the object to be created. See
UIProgressViewStylefor descriptions of the style constants.
Return Value
An initialized UIProgressView object or nil if the object couldn’t be created.
Discussion
UIProgressView sets the height of the returned view according to the specified style. You can set and retrieve the style of a progress view through the progressViewStyle property.
Availability
- Available in iOS 2.0 and later.
Declared In
UIProgressView.hsetProgress:animated:
Adjusts the current progress shown by the receiver, optionally animating the change.
Parameters
- progress
The new progress value.
- animated
YESif the change should be animated,NOif the change should happen immediately.
Discussion
The current progress is represented by a floating-point value between 0.0 and 1.0, inclusive, where 1.0 indicates the completion of the task. The default value is 0.0. Values less than 0.0 and greater than 1.0 are pinned to those limits.
Availability
- Available in iOS 5.0 and later.
Declared In
UIProgressView.hConstants
UIProgressViewStyle
The styles permitted for the progress bar.
typedef enum {
UIProgressViewStyleDefault,
UIProgressViewStyleBar,
} UIProgressViewStyle;
Constants
UIProgressViewStyleDefaultThe standard progress-view style. This is the default.
Available in iOS 2.0 and later.
Declared in
UIProgressView.h.UIProgressViewStyleBarThe style of progress view that is used in a toolbar.
Available in iOS 2.0 and later.
Declared in
UIProgressView.h.
Discussion
You can set and retrieve the current style of progress view through the progressViewStyle property.
Availability
- Available in iOS 2.0 and later.
Declared In
UIProgressView.h© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-10-12)