uiprogressview class reference
TRANSCRIPT
-
7/29/2019 UIProgressView Class reference
1/10
UIProgressView Class Reference
-
7/29/2019 UIProgressView Class reference
2/10
Contents
UIProgressView Class Reference 3
Overview 3
Tasks 4
Initializing the UIProgressView Object 4
Managing the Progress Bar 4
Configuring the Progress Bar 4
Properties 4
progress 4
progressImage 5progressTintColor 5
progressViewStyle 6
trackImage 6
trackTintColor 6
Instance Methods 7
initWithProgressViewStyle: 7
setProgress:animated: 7
Constants 8
UIProgressViewStyle 8
Document Revision History 9
2011-10-12 | Copyright 2011 Apple Inc. All Rights Reserved.
2
-
7/29/2019 UIProgressView Class reference
3/10
Inherits from UIView : UIResponder : NSObject
Conforms to NSCoding
NSCoding (UIView)
UIAppearance (UIView)
UIAppearanceContainer (UIView)
NSObject (NSObject)
Framework /System/Library/Frameworks/UIKit.framework
Availability Available in iOS 2.0 and later.
Declared in UIProgressView.h
Related sample code AVMovieExporter
AVSimpleEditoriOS
DownloadFont
UICatalog
OverviewYou 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 its 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 indicatoror, informally, a spinneruse an instance of theUIActivityIndicatorView class.
2011-10-12 | Copyright 2011 Apple Inc. All Rights Reserved.
3
UIProgressView Class Reference
-
7/29/2019 UIProgressView Class reference
4/10
Tasks
Initializing the UIProgressView Object
initWithProgressViewStyle: (page 7)
Initializes and returns an progress-view object.
Managing the Progress Bar
progress (page 4) property
The current progress shown by the receiver.
setProgress:animated: (page 7)
Adjusts the current progress shown by the receiver, optionally animating the change.
Configuring the Progress Bar
progressViewStyle (page 6) property
The current graphical style of the receiver.
progressTintColor (page 5) property
The color shown for the portion of the progress bar that is filled.
progressImage (page 5) property
An image to use for the portion of the progress bar that is filled.
trackTintColor (page 6) property
The color shown for the portion of the progress bar that is not filled.
trackImage (page 6) property
An image to use for the portion of the track that is not filled.
Properties
progress
The current progress shown by the receiver.
UIProgressView Class Reference
Tasks
2011-10-12 | Copyright 2011 Apple Inc. All Rights Reserved.
4
-
7/29/2019 UIProgressView Class reference
5/10
@property(nonatomic) float progress
Discussion
The current progress is represented by a floating-pointvaluebetween 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.
Related Sample CodeAVMovieExporter
Declared in
UIProgressView.h
progressImage
An image to use for the portion of the progress bar that is filled.
@property(nonatomic, retain) UIImage *progressImage
Discussion
If you provide a custom image, the progressTintColor (page 5) property is ignored.
Availability
Available in iOS 5.0 and later.
Declared in
UIProgressView.h
progressTintColor
The color shown for the portion of the progress bar that is filled.
@property(nonatomic, retain) UIColor *progressTintColor
Availability
Available in iOS 5.0 and later.
Declared in
UIProgressView.h
UIProgressView Class Reference
Properties
2011-10-12 | Copyright 2011 Apple Inc. All Rights Reserved.
5
-
7/29/2019 UIProgressView Class reference
6/10
progressViewStyle
The current graphical style of the receiver.
@property(nonatomic) UIProgressViewStyle progressViewStyle
Discussion
The value of this property is a constant that specifies the style of the progress view. The default style is
UIProgressViewStyleDefault (page 8). For more on these constants, see UIProgressViewStyle (page 8).
Availability
Available in iOS 2.0 and later.
Declared in
UIProgressView.h
trackImage
An image to use for the portion of the track that is not filled.
@property(nonatomic, retain) UIImage *trackImage
Discussion
If you provide a custom image, the trackTintColor (page 6) property is ignored.
Availability
Available in iOS 5.0 and later.
Declared in
UIProgressView.h
trackTintColor
The color shown for the portion of the progress bar that is not filled.
@property(nonatomic, retain) UIColor *trackTintColor
Availability
Available in iOS 5.0 and later.
Declared in
UIProgressView.h
UIProgressView Class Reference
Properties
2011-10-12 | Copyright 2011 Apple Inc. All Rights Reserved.
6
-
7/29/2019 UIProgressView Class reference
7/10
Instance Methods
initWithProgressViewStyle:
Initializes and returns an progress-view object.
- (id)initWithProgressViewStyle: (UIProgressViewStyle)style
Parameters
style
A constant that specifies the style of the object to be created. See UIProgressViewStyle (page 8) for
descriptions of the style constants.
Return Value
An initialized UIProgressView object or nil if the object couldnt 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 (page 6) property.
Availability
Available in iOS 2.0 and later.
Declared in
UIProgressView.h
setProgress:animated:
Adjusts the current progress shown by the receiver, optionally animating the change.
- (void)setProgress:(float)progress animated:(BOOL)animated
Parameters
progress
The new progress value.
animatedYES if the change should be animated, NO if the change should happen immediately.
Discussion
The current progress is represented by a floating-pointvaluebetween 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.
UIProgressView Class Reference
Instance Methods
2011-10-12 | Copyright 2011 Apple Inc. All Rights Reserved.
7
-
7/29/2019 UIProgressView Class reference
8/10
Availability
Available in iOS 5.0 and later.
Declared in
UIProgressView.h
Constants
UIProgressViewStyle
The styles permitted for the progress bar.
typedef enum {UIProgressViewStyleDefault,
UIProgressViewStyleBar,
} UIProgressViewStyle;
Constants
UIProgressViewStyleDefault
The 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 (page 6) property.
Availability
Available in iOS 2.0 and later.
Declared in
UIProgressView.h
UIProgressView Class Reference
Constants
2011-10-12 | Copyright 2011 Apple Inc. All Rights Reserved.
8
-
7/29/2019 UIProgressView Class reference
9/10
This table describes the changes to UIProgressView Class Reference .
NotesDate
Updated for iOS 5.2011-10-12
New document that describes the class for depicting the progress of a
task over time.
2008-05-28
2011-10-12 | Copyright 2011 Apple Inc. All Rights Reserved.
9
Document Revision History
-
7/29/2019 UIProgressView Class reference
10/10
Apple Inc.
Copyright 2011 Apple Inc.
All rights reserved.
No part of this publication may be reproduced,
storedin a retrievalsystem, or transmitted, in any
form or by any means, mechanical, electronic,photocopying, recording, or otherwise, without
prior written permission of Apple Inc., with the
following exceptions: Any person is herebyauthorized to store documentation on a single
computer for personal use only and to print
copies of documentation for personal useprovided that the documentation contains
Apples copyright notice.
No licenses, express or implied, are granted with
respect to anyof thetechnology describedin this
document. Apple retains all intellectual propertyrights associated with the technology described
in this document. This document is intended to
assist application developers to develop
applications only for Apple-labeled computers.
Apple Inc.1 Infinite Loop
Cupertino, CA 95014
408-996-1010
Apple and the Apple logo are trademarks of
Apple Inc., registered in the U.S. and other
countries.
iOS is a trademark or registered trademark ofCisco in the U.S. and other countries and is used
under license.
Even though Apple has reviewed this document,APPLE MAKES NO WARRANTY OR REPRESENTATION,EITHER EXPRESS OR IMPLIED,WITH RESPECT TO THIS
DOCUMENT, ITS QUALITY, ACCURACY,MERCHANTABILITY, OR FITNESS FOR A PARTICULARPURPOSE. AS A RESULT,THIS DOCUMENT IS PROVIDEDAS IS, AND YOU, THE READER, ARE ASSUMING THEENTIRE RISK AS TO ITS QUALITY AND ACCURACY.
IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT,INDIRECT, SPECIAL,INCIDENTAL,OR CONSEQUENTIALDAMAGES RESULTING FROM ANY DEFECT ORINACCURACY IN THIS DOCUMENT, even if advised ofthe possibility of such damages.
THE WARRANTY AND REMEDIES SET FORTH ABOVEARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORALOR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer,agent, or employee is authorized to make anymodification, extension,or addition to this warranty.
Some states do not allow the exclusion or limitationof implied warranties or liability for incidental orconsequential damages, so the above limitation orexclusion may not apply to you. This warranty givesyou specific legal rights, andyou mayalsohaveother
rights which vary from state to state.