gpt4 book ai didi

c# - 你必须调用 Rg.Plugins.Popup.Popup.Init();使用前

转载 作者:行者123 更新时间:2023-12-05 02:15:58 27 4
gpt4 key购买 nike

System.InvalidOperationException:

You MUST call Rg.Plugins.Popup.Popup.Init(); prior to using it.

我已经将 Rg.Plugins.Popup.Popup.Init() 放在 IOS 的 appdelegate.cs 中

但它仍然给我同样的错误我应该怎么做?

最佳答案

简单地说,您需要在启动时调用Rg.Plugins.Popup.Popup.Init();

Android 示例

namespace HelloXamarinFormsWorld.Android
{
[Activity(Label = "HelloXamarinFormsWorld", MainLauncher = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);

// !!!!!! here !!!!!
Rg.Plugins.Popup.Popup.Init(this, bundle);

Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication (new App ());
}
}
}

IOS 示例

[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{

// !!!!!! here !!!!!
Rg.Plugins.Popup.Popup.Init();

global::Xamarin.Forms.Forms.Init ();
LoadApplication (new App ());
return base.FinishedLaunching (app, options);
}
}

请阅读这里的文档

https://github.com/rotorgames/Rg.Plugins.Popup/wiki/Getting-started

关于c# - 你必须调用 Rg.Plugins.Popup.Popup.Init();使用前,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50795975/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com