IOS 中的 AppDelegate 在导航到带有 SfDataGrid 的页面时失败
AppDelegate in IOS fails when navigating to a page with SfDataGrid on it
我在 iOS 上遇到 SfDataGrid 问题,当我尝试导航到名为 "Hovedside" 的页面时,它在 Android 上工作正常
它进入 iOS 部分的 Main.cs
并失败
UIApplication.Main(args, null, "AppDelegate");
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
namespace PrismUnityApp2.iOS
{
public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)
{
try
{
UIApplication.Main(args, null, "AppDelegate");
}
catch (Exception e)
{
throw;
}
}
}
}
使用此输出:
System.NullReferenceException: Object reference not set to an instance of an object
at Syncfusion.SfDataGrid.XForms.iOS.ExtendedScrollViewRenderer.WillMoveToWindow (UIKit.UIWindow window) [0x0000b] in <eee3a5d11e6d415a9b8017bfe242a045>:0
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3818/3983064a/source/xamarin-macios/src/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3818/3983064a/source/xamarin-macios/src/UIKit/UIApplication.cs:63
at PrismUnityApp2.iOS.Application.Main (System.String[] args) [0x00002] in C:\Users\asr\Desktop\GBS APP bakups\PrismUnityApp2 b4 scanner\PrismUnityApp2\PrismUnityApp2.iOS\Main.cs:20
错误列表中没有任何内容
如果我删除 SfDataGrid,它就会很好地导航到页面
我有 syncfusion 显示的必需程序集
https://help.syncfusion.com/xamarin/sfdatagrid/getting-started
我觉得我在 AppDelegate 中遗漏了一些东西,但无法找出它可能是什么
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
using Prism.Unity;
using Microsoft.Practices.Unity;
using Syncfusion.SfDataGrid.XForms.iOS;
namespace PrismUnityApp2.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
ZXing.Net.Mobile.Forms.iOS.Platform.Init();
global::Xamarin.Forms.Forms.Init();
SfDataGridRenderer.Init();
LoadApplication(new App(new iOSInitializer()));
return base.FinishedLaunching(app, options);
}
}
public class iOSInitializer : IPlatformInitializer
{
public void RegisterTypes(IUnityContainer container)
{
}
}
}
https://github.com/ZarpGitHub/PrismUnityApp-gbs
我使用 visual studio 2015 社区、xamarin、prism v6.2.0 Xam.Plugin.Geolocator v3.0.4 和 Syncfusion 14.3451.0.49。
大部分 运行 它在 Android 版本 6.0.1 的索尼 xperia z3 上使用
API 23
我还在虚拟 iphone 6s plus IOS 10.0
上使用它进行测试
非常感谢任何帮助
我们这边已经解决了这个问题。该修复程序将在我们即将于本周发布的第 4 卷主要版本中提供。
此致,
迪瓦卡
我在 iOS 上遇到 SfDataGrid 问题,当我尝试导航到名为 "Hovedside" 的页面时,它在 Android 上工作正常
它进入 iOS 部分的 Main.cs
并失败
UIApplication.Main(args, null, "AppDelegate");
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
namespace PrismUnityApp2.iOS
{
public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)
{
try
{
UIApplication.Main(args, null, "AppDelegate");
}
catch (Exception e)
{
throw;
}
}
}
}
使用此输出:
System.NullReferenceException: Object reference not set to an instance of an object
at Syncfusion.SfDataGrid.XForms.iOS.ExtendedScrollViewRenderer.WillMoveToWindow (UIKit.UIWindow window) [0x0000b] in <eee3a5d11e6d415a9b8017bfe242a045>:0
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3818/3983064a/source/xamarin-macios/src/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3818/3983064a/source/xamarin-macios/src/UIKit/UIApplication.cs:63
at PrismUnityApp2.iOS.Application.Main (System.String[] args) [0x00002] in C:\Users\asr\Desktop\GBS APP bakups\PrismUnityApp2 b4 scanner\PrismUnityApp2\PrismUnityApp2.iOS\Main.cs:20
错误列表中没有任何内容
如果我删除 SfDataGrid,它就会很好地导航到页面
我有 syncfusion 显示的必需程序集 https://help.syncfusion.com/xamarin/sfdatagrid/getting-started
我觉得我在 AppDelegate 中遗漏了一些东西,但无法找出它可能是什么
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
using Prism.Unity;
using Microsoft.Practices.Unity;
using Syncfusion.SfDataGrid.XForms.iOS;
namespace PrismUnityApp2.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
ZXing.Net.Mobile.Forms.iOS.Platform.Init();
global::Xamarin.Forms.Forms.Init();
SfDataGridRenderer.Init();
LoadApplication(new App(new iOSInitializer()));
return base.FinishedLaunching(app, options);
}
}
public class iOSInitializer : IPlatformInitializer
{
public void RegisterTypes(IUnityContainer container)
{
}
}
}
https://github.com/ZarpGitHub/PrismUnityApp-gbs
我使用 visual studio 2015 社区、xamarin、prism v6.2.0 Xam.Plugin.Geolocator v3.0.4 和 Syncfusion 14.3451.0.49。 大部分 运行 它在 Android 版本 6.0.1 的索尼 xperia z3 上使用 API 23 我还在虚拟 iphone 6s plus IOS 10.0
上使用它进行测试非常感谢任何帮助
我们这边已经解决了这个问题。该修复程序将在我们即将于本周发布的第 4 卷主要版本中提供。
此致,
迪瓦卡