c# - 在 iOS 中测试 Xamarin.Forms 应用程序时出现 System.ArgumentOutOfRangeException
问题描述
我有 Xamarin.Forms 应用程序,它在 Android 上运行良好,但在尝试在 iOS 上测试它时,我面临运行时异常。Stacktrace 在下面提到。
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
List`1[T].get_Item (System.Int32 index) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:161
OrderedDictionary`2[TKey,TValue].get_Item (System.Int32 index) D:\a\1\s\Xamarin.Forms.Core\OrderedDictionary.cs:100
TemplatedItemsList`2[TView,TItem].GetGroup (System.Int32 index) D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:569
ITemplatedItemsList<TItem>.GetGroup (System.Int32 index) D:\a\1\s\Xamarin.Forms.Core\TemplatedItemsList.cs:574
ListViewRenderer+UnevenListViewDataSource.GetEstimatedRowHeight (UIKit.UITableView table) D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ListViewRenderer.cs:799
ListViewRenderer+UnevenListViewDataSource.UpdateEstimatedRowHeight (UIKit.UITableView tableView) D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ListViewRenderer.cs:830
ListViewRenderer+ListViewDataSource.DetermineEstimatedRowHeight () D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ListViewRenderer.cs:1281
FormsUITableViewController.ViewWillLayoutSubviews () D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ListViewRenderer.cs:1609
(wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) /Library/Frameworks/Xamarin.iOS.framework/Versions/13.16.0.13/src/Xamarin.iOS/UIKit/UIApplication.cs:86
UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) /Library/Frameworks/Xamarin.iOS.framework/Versions/13.16.0.13/src/Xamarin.iOS/UIKit/UIApplication.cs:65
Application.Main (System.String[] args) ...../[ProjectName].iOS/Main.cs:20
我在用
Xamarin.Forms 版本 4.5.0.617 Xamarin.iOS 版本 13.16.0.13
更新
Main.cs: 20 UIApplication.Main(args, null, "AppDelegate");
解决方案
推荐阅读
- node.js - 旧的nodejs代码导入问题{解决}
- r - 根据其他列中的某些条件查找数据框中某些值的斜率
- python - 如何使用 ajax on key up 将此变量从 django 视图发送到 html?
- java - 如何使用 Maven 为 TestNG 和 Java 检查构建健全性?
- swagger - Swagger-php 在每个模型属性上添加一个“模式”属性
- scala - 关于 Scala Futures 的渴望
- mysql - Nodejs Crypto加密字符串存储在MySQL中后无法正确解密
- r - 为什么 min() 不返回实际的最小值?
- node.js - 无法在节点服务器上发布数据
- javascript - 如何使用javascript触发在javascript上创建的按钮?