覆盖 -navigationBar:shouldPopItem:手动弹出视图控制器后返回 YES



>基本上在iPhone XR上,视图控制器关闭的导航栏由于错误而终止:

覆盖 -navigationBar:shouldPopItem:手动弹出视图控制器后返回 YES (navigationController=('

异常消息已经告诉您发生了什么。 我假设您正在手动弹出视图控制器,如异常消息中所述。如果你这样做,你只需要在重写的shouldPopItem方法中返回false。就是这样!

长话短说(Xamarin.iOS 的代码片段(:

[Export("navigationBar:shouldPopItem:")] public bool ShouldPopItem(UINavigationBar navigationBar, UINavigationItem navigationItem) { PopViewController(animated: true); return false; }

最新更新