A button specialized for placement on a toolbar or tab bar.
SDKs
- iOS 2.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- UIKit
Declaration
class UIBarButtonItem : UIBar Item
Overview
You typically use Interface Builder to create and configure bar button items.
Customizing Appearance
You use the methods listed in Customizing Appearance to customize the appearance of buttons. You send the setter messages to the appearance proxy ([UIBar
) to customize all buttons, or to a specific UIBar
instance. You may use customized buttons in standard places in a UINavigation
object (back
, left
, right
) or a UIToolbar
instance.
In general, you should specify a value for the normal state to be used by other states which don’t have a custom value set. Similarly, when a property is dependent on the bar metrics (on iPhone, in landscape orientation bars have a different height from standard), you should specify a value of UIBar
.
For more information about appearance and behavior configuration, see Toolbars.