Question

I'm sure I'm doing something dumb here, but I can't see it. When I push a DialogViewController onto the navigation stack, my Back button disappears.

My push code is this:

//launch an inspection VC
var vc = new FacilityInspectionListViewController ();
this.NavigationController.PushViewController (vc, true);

and my dialog code is this:

    public FacilityInspectionListViewController () : base(UITableViewStyle.Plain, null) 
    {
        var root = new RootElement ("Root") 
        {
            new Section () 
            {
                new StringElement ("Facility 1", () => {DoSomething();}),
                new StringElement ("Facility 2", () => {DoSomething()}),
                new StringElement ("Facility 3", () => {DoSomething();})
            }
        };

        base.Root = root;
    }

But when I do this, the pushed screen has no Back button:

Screenshot

What am I doing wrong here?

Was it helpful?

Solution

Overwrite the constructor for your Dialog viewcontroller to set the pushing parameter to true.

  1. Stock Monotouch dialog:

    public partial class DetailedZenoView : DialogViewController {
        public DetailedZenoView () : base (null, true) {
        }
    ...
    
  2. MvvmCross (CrossUI) dialog:

    public partial class DetailedZenoView : MvxDialogViewController {
        public DetailedZenoView () : base ((UITableViewStyle)1, null, true) {
        }
    ...
    
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top