Hey cracked it !!!

Thanks Craig you;re a star

 

From: [email protected] [mailto:[email protected]] On Behalf Of Craig
Dunn
Sent: 09 May 2012 00:36
To: [email protected]
Cc: [email protected]
Subject: Re: [MonoTouch] mainnavigationcontrller buttons

 

Hey John,

 

do you want to give this a try?

 

NavigationItem.SetRightBarButtonItem (new UIBarButtonItem
(UIBarButtonSystemItem.Add), false);

NavigationItem.RightBarButtonItem.Clicked += (sender, e) => {
Console.WriteLine("Right Bar Button Clicked!"); };

 

 

this particular snippet is from the Tasky sample

https://github.com/xamarin/mobile-samples/blob/TheNewTasky/Tasky/TaskyiOS/Sc
reens/HomeScreen.cs

(you can see the [+] button in this screenshot
<https://github.com/xamarin/mobile-samples/raw/TheNewTasky/Tasky/Screenshots
/iOS/Home.png> )

 

HTH

craig

 

On Tue, May 8, 2012 at 9:37 PM, John Murray <[email protected]> wrote:

I have a 5 pages (left right swipe) which is created by adding views to a
scroll view (as in Wally's et altera's book) 

 

A navigation controller exists - I presume it is the one automatically
created in the AppDelegate

 

So I can either show it with a title thus 

 

this.NavigationController.NavigationItem.Title = "Hello  World"

 

 

Or hide it 

this.NavigationController.NavigationBarHidden= true;

 

 

 

 

What I cant seem to do is add a button to it 

 

I've tried various stuff such as 

 

This.NavigationController.NavigationItem.RightBarButtonItem = new
UIButtonBarItem("go",UIBarButtonItemStyle.Plain,dosomething);

 

 

 

I am sure I am missing the obvious here or is it not possible to put buttons
on the root navigation ?

 

 

Tia 

JM 

 

 


_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

 

_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to