问题
I have init codes of both circle image and pop up image in App.xaml.cs. Only the first code is working, the code after Xamarin.Forms.Forms.Init is not working. My current code is adding below:
//ImageCircle
var rendererAssemblies = new[]
{
typeof(ImageCircleRenderer).GetTypeInfo().Assembly
};
Xamarin.Forms.Forms.Init(e, rendererAssemblies);
//Popup
Rg.Plugins.Popup.Popup.Init();
Xamarin.Forms.Forms.Init(e, Rg.Plugins.Popup.Popup.GetExtraAssemblies());
Now image circle is working and pop up image is not working, how to add multiple init codes at a time?
Thanks in advance.
回答1:
Try this:
//ImageCircle
var rendererAssemblies = new List<Assembly>
{
typeof(ImageCircleRenderer).GetTypeInfo().Assembly
};
rendererAssemblies.AddRange(Rg.Plugins.Popup.Popup.GetExtraAssemblies());
//Popup
Rg.Plugins.Popup.Popup.Init();
Xamarin.Forms.Forms.Init(e, rendererAssemblies);
来源:https://stackoverflow.com/questions/51758644/xamarin-forms-how-to-add-multiple-init-codes-at-a-time-in-app-xaml-cs-for-uwp