Thanks James.  Unfortunately, that's not it.  As always, all suggestions are 
appreciated.
Wally

From: [email protected]
Date: Mon, 13 Jun 2011 15:43:16 -0500
Subject: RE: [MonoTouch] adding a back button
To: [email protected]; [email protected]



I think you have a scope issue.  Try promoting the button variable to a class 
level variable.
 
James Texter III
|
Technical Guru
|[email protected]
300 Johnny Bench Dr. Suite 120
|
Oklahoma City, OK 73104
|888-426-5730
|
www.monscierge.com
 
From: [email protected] 
[mailto:[email protected]] On Behalf Of Wally McClure

Sent: Monday, June 13, 2011 3:37 PM
To: [email protected]
Subject: [MonoTouch] adding a back button
 I wanted to add a back button on my view when I load it.  Unfortunately, I am 
unable to get the back button to display.  I have the code below in my 
ViewDidLoad() method.  Any suggestions are appreciated.
                         public override void ViewDidLoad()
                        {
                                    // Do some other things
                            var btn = new UIBarButtonItem ("Back", 
UIBarButtonItemStyle.Plain, delegate (object sender, EventArgs e) {
                                          Console.WriteLine("BarButtonItem 
clicked.");
                                    });
                                    
                                    ToolbarItems = new UIBarButtonItem[] {btn};
                                    SetToolbarItems(ToolbarItems, true);
                                    base.ViewDidLoad();
                        }
                                          
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to