带有MVVMCross和Storyboard的本机Xamarin.IOS应用程序不起作用

时间:2019-01-25 05:06:02

标签: xamarin mvvm xamarin.ios mvvmcross

我创建了一个新的MVVMCross Native项目,并将其迁移到v6.2.2。创建了一个名为HomeView的单一视图,类似于https://www.mvvmcross.com/documentation/tutorials/tipcalc/a-xamarinios-ui-project

xib页面只有一个UITextFieldUIButton。但是,在应用启动后,出现以下异常 Name: NSInvalidArgumentException Reason: -[HomeView _setViewDelegateContentOverlayInsetsAreClean:]: unrecognized selector sent to instance 0x7fe8edc3cd70

我的HomeView.cs文件如下:

[MvxRootPresentation(WrapInNavigationController = true)]
public partial class HomeView : MvxViewController
{
    public HomeView() : base("HomeView", null){}

    public HomeView(IntPtr handle) : base(handle){}

    public override void DidReceiveMemoryWarning()
    {
        // Releases the view if it doesn't have a superview.
        base.DidReceiveMemoryWarning();
        // Release any cached data, images, etc that aren't in use.
    }

    #region View lifecycle
    public override void ViewDidLoad()
    {
        base.ViewDidLoad();

        var set = this.CreateBindingSet<HomeView, HomeViewModel>();
        set.Bind(TextField).To(vm => vm.Text);
        set.Bind(Button).To(vm => vm.ResetTextCommand);
        set.Apply();

        // Perform any additional setup after loading the view, typically from a nib.
    }

    public override void ViewWillAppear(bool animated)
    {
        base.ViewWillAppear(animated);
    }

    public override void ViewDidAppear(bool animated)
    {
        base.ViewDidAppear(animated);
    }

    public override void ViewWillDisappear(bool animated)
    {
        base.ViewWillDisappear(animated);
    }

    public override void ViewDidDisappear(bool animated)
    {
        base.ViewDidDisappear(animated);
    }

    #endregion
}

0 个答案:

没有答案