See Also: UIToolbar Members
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:
