I’m working with MonoTouch and I have come up with three questions around buttons that I’m hoping someone can help me with.
-
I’m trying to change the “Back” button in the title bar. How do I do this? I’ve seen the thread posted here: How to change text on a back button. However, that doesn’t work. I get the vibe that I’m not accessing the controller property. Currently, I receive a NullReferenceException when I attempt to set the button text in the ViewDidLoad method. Currently, I’m trying to set the text like such:
this.NavigationItem.BackBarButtonItem.Title = “Back”;
I have the suspicion that I’m not accessing the root controller, but I’m not sure how to do this.
-
For a “back” button on a separate page, I want to perform a custom action. I want it to go back like it does. But before that happens, I want to execute some custom code. How do I do this?
-
I need to create something that looks like a hyperlink within a paragraph of text. How do I do that?
MonoTouch seems cool. However, the learning curve is a bit steeper than I had anticipated. Thank you!
For your first question the MonoTouch-specific answer (to the question you provided) works perfectly.
Make sure to the all the answers. This code needs to be called in the pushing controller, not the controller being pushed.
UPDATE
For your second question you likely noticed a few overloads that takes a
Selectoror adelegate. However they won’t work for a Back button.One way to work around this iOS limitation is to override
ViewDidAppearorViewDidDisappearto get similar notification.