Inherits from | |
Conforms to | |
Framework | /System/Library/Frameworks/UIKit.framework |
Availability | Available in iOS 2.0 and later. |
Declared in | UIToolbar.h |
An instance of the UIToolbar
class is a control for selecting one of many buttons, called toolbar items. A toolbar momentarily highlights or does not change the appearance of an item when tapped. Use the UITabBar
class if you need a radio button style control.
Use the UIBarButtonItem
class to create items and the setItems:animated:
method to add them to a toolbar. All methods with an animated:
argument allow you to optionally animate changes to the display.
Toolbar images that represent normal and highlighted states of an item derive from the image you set using the inherited image
property from the UIBarItem
class. For example, the image is converted to white and then bevelled by adding a shadow for the normal state.
barStyle
property
tintColor
property
translucent
property
items
property
– setItems:animated:
For more about Objective-C properties, see “Properties” in The Objective-C Programming Language.
The toolbar style that specifies its appearance.
@property(nonatomic) UIBarStyle barStyle
See UIBarStyle
for possible values. The default value is UIBarStyleDefault
.
UIToolbar.h
The items displayed on the toolbar.
@property(nonatomic, copy) NSArray *items
The items, instances of UIBarButtonItem
, that are visible on the toolbar in the order they appear in this array. Any changes to this property are not animated. Use the setItems:animated:
method to animate changes.
The default value is nil
.
UIToolbar.h
The color used to tint the bar.
@property(nonatomic, retain) UIColor *tintColor
The default value is nil
.
UIToolbar.h
A Boolean value that indicates whether the toolbar is translulcent (YES
) or not (NO
).
@property(nonatomic,assign,getter=isTranslucent) BOOL translucent
Applying translucence to a toolbar is intended primarily for landscape orientation, when you want the user to be able to view the area beneath the toolbar. The default value for this property is NO
. However, if you set the toolbar style to UIBarStyleBlackTranslucent
, the value for this property is always YES
.
UIToolbar.h
Sets the items on the toolbar by animating the changes.
- (void)setItems:(NSArray *)items animated:(BOOL)animated
The items to display on the toolbar.
A Boolean value if set to YES
animates the transition to the items; otherwise, does not.
If animated is YES
, the changes are dissolved or the reordering is animated—for example, removed items fade out and new items fade in. This method also adjusts the spacing between items.
UIToolbar.h
Last updated: 2009-03-09