使用 IOS 在 Xamarin.iOS 上向右滑动 13 不会激活效果
Swipe right on Xamarin.iOS with IOS 13 doesn't animate the effect
我有 Xamarin Native (iOS/Droid) 应用程序。在较旧的 iOS 版本中,可以通过向右滑动一个将当前视图拖动到屏幕的动画来导航回以前的 viewController。更新到最新的iOS13后,这个动画就没有了。 ViewWillDissapper 也不会被调用。
我错过了什么?
我已经尝试过以下更改:
this.ModalInPresentation = true;
this.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
NavigationController.InteractivePopGestureRecognizer.Enabled = true;
NavigationController.InteractivePopGestureRecognizer.Delegate = new MyGestureDelegate();
在 iOS 13 中,您可以在 之前的 ViewController 中设置如下:
UIViewControllerSecond viewControllerSecond = new UIViewControllerSecond();
viewControllerSecond.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
viewControllerSecond.ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal;
PresentViewController(viewControllerSecond, true, null);
然后在第二个ViewController刚DismissModalViewController(true);
回来的时候。
UISwipeGestureRecognizer swipeGesture = new UISwipeGestureRecognizer();
swipeGesture.Direction = UISwipeGestureRecognizerDirection.Right;
swipeGesture.AddTarget(() => { Console.WriteLine("-swipe-to-right-"); DismissViewController(true, null); });
View.AddGestureRecognizer(swipeGesture);
看看这个效果,是否需要。
该应用正在使用 Xamarin Native 和 Mvvm Cross。原来4.4版本的mvvm交叉包不支持iOS13,更新到5.7解决了我的问题
我有 Xamarin Native (iOS/Droid) 应用程序。在较旧的 iOS 版本中,可以通过向右滑动一个将当前视图拖动到屏幕的动画来导航回以前的 viewController。更新到最新的iOS13后,这个动画就没有了。 ViewWillDissapper 也不会被调用。 我错过了什么?
我已经尝试过以下更改:
this.ModalInPresentation = true;
this.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
NavigationController.InteractivePopGestureRecognizer.Enabled = true;
NavigationController.InteractivePopGestureRecognizer.Delegate = new MyGestureDelegate();
在 iOS 13 中,您可以在 之前的 ViewController 中设置如下:
UIViewControllerSecond viewControllerSecond = new UIViewControllerSecond();
viewControllerSecond.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
viewControllerSecond.ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal;
PresentViewController(viewControllerSecond, true, null);
然后在第二个ViewController刚DismissModalViewController(true);
回来的时候。
UISwipeGestureRecognizer swipeGesture = new UISwipeGestureRecognizer();
swipeGesture.Direction = UISwipeGestureRecognizerDirection.Right;
swipeGesture.AddTarget(() => { Console.WriteLine("-swipe-to-right-"); DismissViewController(true, null); });
View.AddGestureRecognizer(swipeGesture);
看看这个效果,是否需要。
该应用正在使用 Xamarin Native 和 Mvvm Cross。原来4.4版本的mvvm交叉包不支持iOS13,更新到5.7解决了我的问题