亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在 MVVMCross 中從 4.4 遷移到 5.7 時出現 CustomPresenter 錯誤

在 MVVMCross 中從 4.4 遷移到 5.7 時出現 CustomPresenter 錯誤

C#
絕地無雙 2023-12-17 10:21:20
我正在開發一個使用 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


查看完整回答
反對 回復 2023-12-17
  • 1 回答
  • 0 關注
  • 141 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號