【问题标题】:Monotouch.Dialog - Setting Back ButtonMonotouch.Dialog - 设置返回按钮
【发布时间】:2011-03-15 05:38:16
【问题描述】:

我使用 MonoTouch.Dialog DialogViewController 来创建一个漂亮的视图。

private RootElement _createRoot(){
    return new RootElement ("Buy a Property Report"){

            new Section (""){
                new StringElement ("View Sample", ()=>{ }),
                new StringElement ("Enter Address", ()=>{ }),
                new StringElement ("Locate This House", () => { }),
                new StringElement ("My Reports", () => { })
            } 
        };
}

在以下屏幕上,我需要一个不同于我在之前的“购买房产报告”到“主页”中指定的返回按钮

我这样做。

public override void ViewDidLoad ()
{
    base.ViewDidLoad ();
        this.NavigationController.NavigationBar.TopItem.Title = "Home";
}

有没有办法在 Monotouch.Dialog 中执行此操作?

【问题讨论】:

    标签: iphone ipad xamarin.ios monotouch.dialog


    【解决方案1】:

    我不确定我是否理解您的问题,但请尝试在对话框控制器上使用它:

    this.NavigationItem.BackBarButtonItem.Title = "Home";
    

    【讨论】:

    • 您在 DVC 生命周期的哪个阶段执行此操作?如果我在ViewDidLoad 中执行此操作,BackBarButtonItem 仍然为空。如果我在ViewDidAppear 中执行此操作,您可以在默认标题更改为“主页”之前简要看到它。
    猜你喜欢
    • 2019-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-12
    • 2016-10-29
    • 1970-01-01
    • 1970-01-01
    • 2013-07-26
    相关资源
    最近更新 更多