Xamarin 问题 "self.isModalInPresentation = false" 不工作

Xamarin issue "self.isModalInPresentation = false" not working

我试图禁用弹出框上的滑动效果 controller.My xamarin 应用程序 运行 ios 13 向下滑动弹出框控制器时遇到一些问题,所以我需要禁用默认的滑动效果在弹出控制器上。在 objective c 和 swift 中它有一个 属性 "isModelInPresentation" 但在 xamarin 中它不可用。任何机构都可以帮助禁用滑动弹出窗口吗?

modalInPresentation : 一个布尔值,指示视图控制器是否强制执行模态行为。

The default value of this property is NO. When you set it to YES, UIKit ignores events outside the view controller's bounds and prevents the interactive dismissal of the view controller while it is onscreen.

在Xamarin.iOS中,如果设置ModalInPresentation = True,滑动时viewController不会消失。否则会消失。

public override void ViewDidLoad()
{
    View = new UniversalView();

    base.ViewDidLoad();
    this.Title = "Second";
    View.BackgroundColor = UIColor.Yellow;
    ModalInPresentation = true;
    // Perform any additional setup after loading the view
}

效果:

在当前页面的 ViewDidLoad 中使用 ModalInPresentation = true;

或者,

在显示页面的代码之前使用 YourPresentingPage.ModalInPresentation = true;