iPhone NavigationControl Toolbar items

Posted by BahaiResearch.com on Stack Overflow See other posts from Stack Overflow or by BahaiResearch.com
Published on 2010-05-21T00:08:06Z Indexed on 2010/05/21 0:10 UTC
Read the original article Hit count: 741

MonoTouch preferred, but Obj-C ok too

My MainWindow.xib has a NavigationView and a View. The View appears nicely and works, but I need to add buttons to the toolbar that is part of the NavigationView. I can see the toolbar in IB.

In this View I try to add buttons to the toolbar, but they do not appear.

UIBarButtonItem btnBrowse = new UIBarButtonItem ("Browse", UIBarButtonItemStyle.Bordered, null);
UIBarButtonItem btnOptions = new UIBarButtonItem ("Options", UIBarButtonItemStyle.Bordered, null);
UIBarButtonItem btnBibles = new UIBarButtonItem ("Bibles", UIBarButtonItemStyle.Bordered, null);
UIBarButtonItem btnSpacer = new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace);
void WireUpCommands ()
{
    this.NavigationController.Toolbar.SetItems (new[] { btnOptions, btnSpacer, btnBrowse, btnSpacer, btnBibles }, false); 
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about monotouch