iPhone编程 - 按钮上的更改屏幕单击

时间:2013-05-23 17:45:31

标签: c# iphone xamarin.ios xamarin

我正在开发一个有3层屏幕的简单iPhone应用程序。第二层连接到第三层时出现问题 - 您将看到下面的代码,主要是从教程中提取的。在Xamarin Studio中,“TouchUpInside”以红色突出显示为错误。如果你能提供帮助,请告诉我。

错误:表达式表示“方法组”,其中包含“变量”,“值”或“类型”。

public override void ViewDidLoad ()
    {
        base.ViewDidLoad ();
        //---- when the hello world button is clicked
        this.btnNext.TouchUpInside += (sender, e) => {
            //---- instantiate a new hello world screen, if it's null
            // (it may not be null if they've navigated backwards
            if(this.helloWorldScreen2 == null)
            { this.helloWorldScreen2 = new HelloWorldScreen2(); }
            //---- push our hello world screen onto the navigation
            //controller and pass a true so it navigates
                 this.NavigationController.PushViewController(this.helloWorldScreen2, true);
        };

    }

0 个答案:

没有答案
相关问题