我正在開發一個使用 MVVMCross 和 Xamarin for iOS 和 Android 構建的項目。我發現該項目使用了相當舊的 MVVMCross 版本(4.4.0),我正在嘗試將其升級到當前版本(6.4)。我認為首先升級到 5.7 是個好主意,在稍后階段,當我將導航切換到新形式等時,我將升級到 6++。我已經成功地將android版本運行到5.7,但是,iOS版本使用了customPresenter,我不太知道如何轉換為5.1中引入的新Presenter。我認為我的自定義演示器基于 https://github.com/MvvmCross/MvvmCross-Samples/tree/master/XPlatformMenus/XPlatformMenusTabs.iOS有一段時間沒有更新了。在我的 MvxTabPresenter 子類中,show 函數不再是可重寫的。另外 IMvxModalIosView 似乎不再存在。public override void Show(IMvxIosView view) { if (view is IMvxModalIosView) { if (this._currentModalViewController != null) { return; } var currentModalViewController = view as MvxViewController; this._currentModalViewController = currentModalViewController; currentModalViewController.ModalPresentationStyle = UIModalPresentationStyle.Popover; CurrentTopViewController.AddChildViewController(currentModalViewController); currentModalViewController.View.Frame = CurrentTopViewController.View.Bounds.Inset(10, 10); currentModalViewController.View.Alpha = 0; CurrentTopViewController.View.Add(currentModalViewController.View); currentModalViewController.DidMoveToParentViewController(CurrentTopViewController); UIView.Animate(0.25, () => { currentModalViewController.View.Alpha = 1; }); //this.PresentModalViewController(currentModalViewController, true); return; } if (view is HomeView) { if (this.CurrentTopViewController is MvxTabBarViewController) { TabBarPresenter.SelectedIndex = 0; return; base.CloseModalViewController(); } }而且,這不再可以從超類中覆蓋。關于如何解決這個問題有什么建議嗎?親切的問候, V
1 回答

慕勒3428872
TA貢獻1848條經驗 獲得超6個贊
正如您在?MvxIosViewPresenter?中看到的,現在 mvx 屬性已注冊到應調用的操作中。
因此,首先您應該繼承自MvxIosViewPresenter
。然后,對于模式,您應該覆蓋?ShowModalViewController
。
- 1 回答
- 0 關注
- 141 瀏覽
添加回答
舉報
0/150
提交
取消