iOS Guides | Samples

MonoTouch.UIKit.UIBarButtonItem Class

A button item hosted in either a UIToolbar or a UINavigationBar.

See Also: UIBarButtonItem

Syntax

[MonoTouch.Foundation.Register("UIBarButtonItem", true)]
public class UIBarButtonItem : UIBarItem, IDisposable

See Also

Remarks

UIBarButtonItems are special buttons designed to be placed in either a UIToolbar or a UINavigationBar. They show either a title or an image and change their appearance when pressed. UIBarButtonItems can also be set to a number of system provided button styles available in the UIBarButtonSystemItem enumeration.

Related content

Requirements

Namespace: MonoTouch.UIKit
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0

The members of MonoTouch.UIKit.UIBarButtonItem are listed below.

See Also: UIBarItem

Public Constructors

Default constructor that initializes a new instance of this class with no parameters.
A constructor that initializes the object from the data stored in the unarchiver object.
Constructor to call on derived classes to skip initialization and merely allocate the object.
Constructor that allows a particular UIBarButtonSystemItem to be specified when the button is created.
Constructor that allows a custom view to be specified for a UIBarButtonItem.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.
Constructor that allows a particular UIBarButtonSystemItem to be specified when the button is created along with an event handler.
Constructor that allows a system item along with a target-action pair to be specified.
Constructor that allows a custom image, style and evnet handler to be specied when the button is created.
Constructor that allows a title to be specified for display on the button depending on the style used. Also allows an event handler to be specified that will be called when the button is pressed.
Constructor that allows an image and style to be specified, along with a target-action pair.
Constructor that allows specifying a title and style for a UIBarButtonItem along with an Objective-C style target-action pair.
Constructor that allows specifying separate images for landscape and portrait.

Public Properties

ActionSelector. The action sent to the object specified as the target.
[read-only]
static
AppearanceUIBarButtonItem+UIBarButtonItemAppearance. Strongly-typed property that returns the UIAppearance class for this class.
[read-only]
ButtonGroupUIBarButtonItemGroup. The UIBarButtonItemGroup, if any, to which this UIBarButtonItem belongs.
[read-only]
override
ClassHandleIntPtr. The handle for this class.
CustomViewUIView. A custom view used to represent the UIBarButtonItem
override
EnabledBoolean. Allows control over whether a UIBarButtonItem is enabled or disabled.
override
ImageUIImage. The button's image.
override
ImageInsetsUIEdgeInsets. Insets the button image.
PossibleTitlesNSSet. The set of all possible titles (used as a hint for system sizing).
StyleUIBarButtonItemStyle. The system style to use for the button.
override
TagInt32. An integer that can be used to indentify the UIBarButtonItem.
TargetNSObject. The object that will receive the selector specified in the Action property.
TintColorUIColor. The tint color to be used for the button.
override
TitleString. The title that is displayed in the button
WidthSingle. The width of the button.

Public Methods

static
AppearanceWhenContainedIn(params Type[]) : UIBarButtonItem+UIBarButtonItemAppearance
Returns a strongly typed UIAppearance for instances of this class when the view is hosted in the specified hierarchy.
static
GetAppearance(UITraitCollection) : UIBarButtonItem+UIBarButtonItemAppearance
Returns an appearance proxy for the specified traits.
static
GetAppearance(UITraitCollection, params Type[]) : UIBarButtonItem+UIBarButtonItemAppearance
Returns an appearance proxy for the specified traits when found in the containers containment hierarchy.
static
GetAppearance<T>() : UIBarButtonItem+UIBarButtonItemAppearance
Obtains the appearance proxy UIBarButtonItemAppearance for the subclass of UIBarButtonItem.
static
GetAppearance<T>(UITraitCollection) : UIBarButtonItem+UIBarButtonItemAppearance
Obtains the appearance proxy UIBarButtonItemAppearance for the subclass of UIBarButtonItem.
static
GetAppearance<T>(UITraitCollection, params Type[]) : UIBarButtonItem+UIBarButtonItemAppearance
Obtains the appearance proxy UIBarButtonItemAppearance for the subclass of UIBarButtonItem that has the specified trait collection when the view is hosted in the specified hierarchy.
GetBackButtonBackgroundImage(UIControlState, UIBarMetrics) : UIImage
Back button background image for a given control state. Only used for a UINavigationBar back button.
GetBackButtonBackgroundVerticalPositionAdjustment(UIBarMetrics) : Single
The back button vertical position offset.
GetBackButtonTitlePositionAdjustment(UIBarMetrics) : UIOffset
The back button title offset.
GetBackgroundImage(UIControlState, UIBarMetrics) : UIImage
The background image for the button.
GetBackgroundImage(UIControlState, UIBarButtonItemStyle, UIBarMetrics) : UIImage
The UIImage used as a background by the UIBarButtonItem.
GetBackgroundVerticalPositionAdjustment(UIBarMetrics) : Single
The vertical offset of the background image.
GetTitlePositionAdjustment(UIBarMetrics) : UIOffset
Title offset for specified bar metrics..
SetBackButtonBackgroundImage(UIImage, UIControlState, UIBarMetrics)
Allows the button's background image to be set.
SetBackButtonBackgroundVerticalPositionAdjustment(Single, UIBarMetrics)
Allows the vertical offset of the back button image to be specified for a given control state and bar metrics.
SetBackButtonTitlePositionAdjustment(UIOffset, UIBarMetrics)
Allows the offset of the back button title to be specified for a given control state and bar metrics.
SetBackgroundImage(UIImage, UIControlState, UIBarMetrics)
Allows the background image to be set for the button for a given control state and bar metrics.
SetBackgroundImage(UIImage, UIControlState, UIBarButtonItemStyle, UIBarMetrics)
Specifies the UIImage used as a background.
SetBackgroundVerticalPositionAdjustment(Single, UIBarMetrics)
Allows the background image to be offset for the specified bar metrics.
SetTitlePositionAdjustment(UIOffset, UIBarMetrics)
Allows the title to be offset for a specified bar metrics.

Protected Methods

override
Dispose(Boolean)
Releases the resources used by the UIBarButtonItem object.

Public Events

ClickedThis event is raised when the user clicks/taps on this UIBarButtonItem.