UIKit.UIToolbar Class
A UIKit.UIView that displays a toolbar.

See Also: UIToolbar Members

Syntax

[Foundation.Register("UIToolbar", true)]
public class UIToolbar : UIView, IUIBarPositioning, IDisposable

Remarks

To set UIKit.UIBarButtonItem items in a UIKit.UIToolbar, assign to the UIToolbar.Items property of the UIKit.UIToolbar. To space items, use UIBarButtonItem.FlexibleSpace as shown in the following example:

C# Example

var tb = new UIToolbar(toolbarFrame);
var bbs = new UIBarButtonItem[] {
    new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
    new UIBarButtonItem(UIBarButtonSystemItem.Action),
    new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
    new UIBarButtonItem(UIBarButtonSystemItem.Add),
    new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),

    new UIBarButtonItem(UIBarButtonSystemItem.Bookmarks),
    new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace)
};
tb.SetItems(bbs, false);
          

The previous code creates a toolbar that looks like this:

Related content

Requirements

Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0