iOS MonoTouch: Add a Nav Bar Bottom ToolBar in MonoTouch

Adding a toolbar at the bottom of an iOS application is really easy.
See more information here: MonoTouch Docs

//-- using the built in icons
var refreshButton = new UIBarButtonItem(UIBarButtonSystemItem.Refresh, (s, e) => {
    Console.WriteLine("Refresh clicked");
})

//-- using your own icon
var imageButton = new UIBarButtonItem(UIImage.FromBundle("myIcon.png"), (s, e) => {
    Console.WriteLine("Pause clicked");
})

var spacer = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace) { Width = 50 };

this.SetToolbarItems( new UIBarButtonItem[] {
    spacer, refreshButton, spacer, imageButton, spacer
}, false);

this.NavigationController.ToolbarHidden = false;

Leave a comment