I have a tab bar controller, which then goes to the navigation controller (in the storyboard using flyoutnavcontollers too). One of the viewcontrollers from here runs in the dialogviewcontroller for the material MT.D.
I wanted the beautiful pointy / narrowed back button from the monotouch dialog to return to my call point in the navigation controller.
But starting in MT.D loses navigation, even when im uses the current navigation controller for some reason, that is, the button does not appear and cannot return. Subsequent mt.d screens give a back button.
Apparently you should pass a true boolean call to enable the back button, and by clicking on the existing stack, but that did not help me:
this.NavigationController.PushViewController (dv, true);
Dan above solution does not work for me. But the appearance of the current dialog manager, while on the root screen, MT.D helps to return to my previous position in the original navigation controller in the storyboard (or flyoutnav controller).
Not sure if this hack is correct, but it works.
dv.NavigationItem.RightBarButtonItem = new UIBarButtonItem("Back",UIBarButtonItemStyle.Bordered,delegate(object sender,EventArgs e) { NavigationController.PopViewControllerAnimated(true); });
* update
I managed to get the back button by adding a dialogviewcontroller to the current viewcontrollers subview:
dvc = new MyDvcController(this.NavigationController); this.View.AddSubview(dvc.TableView);
the corresponding MyDvcController basically looks like this:
public partial class MyDvcController : DialogViewController { public MyDvcController (UINavigationController nav): base (UITableViewStyle.Grouped, null) { navigation = nav; Root = new RootElement ("Demos"){ new Section ("Element API"){ new StringElement ("iPhone Settings Sample", DemoElementApi), } }; } }
this allowed monotouch.dialog to be part of the current stack of navigation controllers and get an automatic return button with a narrowed look. yay