Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin “沙马林问题”;self.isModalInPresentation=false";不起作用_Xamarin_Xamarin.ios_Popover - Fatal编程技术网

Xamarin “沙马林问题”;self.isModalInPresentation=false";不起作用

Xamarin “沙马林问题”;self.isModalInPresentation=false";不起作用,xamarin,xamarin.ios,popover,Xamarin,Xamarin.ios,Popover,我试图在popover控制器上禁用滑动效果。我运行ios 13的xamarin应用程序在向下滑动popover控制器时遇到一些问题,因此我需要在popover控制器上禁用默认滑动效果。在目标c和swift中,它具有“isModelInPresentation”属性,但在xamarin中不可用。任何主体都可以帮助禁用滑动popover吗?:一个布尔值,指示视图控制器是否强制模式行为 此属性的默认值为否。当您将其设置为YES时,UIKit将忽略视图控制器边界之外的事件,并防止视图控制器在屏幕上时被交

我试图在popover控制器上禁用滑动效果。我运行ios 13的xamarin应用程序在向下滑动popover控制器时遇到一些问题,因此我需要在popover控制器上禁用默认滑动效果。在目标c和swift中,它具有“isModelInPresentation”属性,但在xamarin中不可用。任何主体都可以帮助禁用滑动popover吗?

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

此属性的默认值为。当您将其设置为YES时,UIKit将忽略视图控制器边界之外的事件,并防止视图控制器在屏幕上时被交互式取消

在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
}
其效果是:


使用
ModalInPresentation=trueViewDidLoad
中的code>

或者


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

navctlr.interactiveepogesturerecognizer.Enabled=false;这行吗?谢谢你的回复。我已经尝试过了。然后我得到错误“名称'ModalInPresentation'在当前上下文(CS0103)(WBid.wbidpad.iOS)中不存在”@graycoder-Okey,在Xamarin.iOS项目中的设置位置共享您的代码。我发现了问题。感谢您的支持,我使用的是xaamrin.ios旧版本。当我更新时,我可以使用ModelInPresentation。@graycoder太棒了!如果答案有帮助,您可以将其标记为:-)