Monotouch Dialog杀死我的UINavigationController后退按钮

时间:2013-06-27 19:28:52

标签: ios xamarin.ios monotouch.dialog

我确定我在这里做一些蠢事,但我看不到它。当我将DialogViewController推到导航堆栈上时,我的后退按钮就会消失。

我的推送代码是:

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

我的对话框代码如下:

    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;
    }

但是当我这样做时,推动的屏幕没有后退按钮:

Screenshot

我在这里做错了什么?

1 个答案:

答案 0 :(得分:12)

覆盖Dialog视图控制器的构造函数,将推送参数设置为true。

  1. Stock Monotouch对话框:

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

    public partial class DetailedZenoView : MvxDialogViewController {
        public DetailedZenoView () : base ((UITableViewStyle)1, null, true) {
        }
    ...