简体   繁体   English

IOS App中的向后滑动功能

[英]Swipe back function in IOS App

I am working on an application in Xamarin. 我正在Xamarin中开发应用程序。 The iOS feature of swipe back is not working and I don't know how to figure it out and fix it. 向后滑动的iOS功能不起作用,我不知道如何解决并修复它。 Any kind of help will be appreciated. 任何帮助将不胜感激。 Where can I find this feature in my app code files and. 我在哪里可以在我的应用程序代码文件中找到此功能。 how to enable or disable it? 如何启用或禁用它?

self.navigationController.interactivePopGestureRecognizer.delegate = nil;

You can create a UIGestureRecognizerDelegate , in this Delegate we can use an event called ShouldBegin() to enable or disable the system back feature: 您可以创建一个UIGestureRecognizerDelegate ,在此Delegate中,我们可以使用一个名为ShouldBegin()的事件来启用或禁用系统后退功能:

public class MyGestureDelegate : UIGestureRecognizerDelegate
{
    public override bool ShouldBegin(UIGestureRecognizer recognizer)
    {
        return true;
    }
}

Then assign the Delegate to it: 然后将Delegate分配给它:

NavigationController.InteractivePopGestureRecognizer.Delegate = new MyGestureDelegate();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM