2

我有一个 Xamarin Forms 应用程序,它可以在 Android 和 iOS 模拟器上完美运行,但是如果我尝试在 iOS 设备上部署它,它会在我看到我的第一个屏幕时崩溃。

有时它会在日志中写入 MT1107 错误,但有时不会

这是我的 iOS 设备日志: http: //pastebin.com/uGp5K7Pg

4

1 回答 1

4

检查 PasteBin 的第 70 行:

Sequence contains no elements (System.InvalidOperationException)
at System.Linq.Enumerable.Last[UIViewController] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
at Xamarin.Forms.Platform.iOS.NavigationRenderer.<.ctor>b__0 (Xamarin.Forms.Platform.iOS.TabletMasterDetailRenderer sender) [0x00000] in <filename unknown>:0
at Xamarin.Forms.MessagingCenter+<>c__DisplayClass4`1[Xamarin.Forms.Platform.iOS.TabletMasterDetailRenderer].<Subscribe>b__3 (System.Object sender, System.Object args) [0x00000] in <filename unknown>:0

看来您正在将 a 包装MasterDetailPageNavigationPage. 在 iOS(更具体地说:iPad)上,这使用 a UISplitViewController,它不能嵌入到UINavigationController. Xamarin.Forms 尽可能使用本机控件。

尝试检查设备操作系统和习语:如果您在 iPad 上,请不要NavigationPage在页面周围环绕。

于 2015-08-26T13:22:04.590 回答