【发布时间】:2018-04-02 16:35:09
【问题描述】:
我的应用程序可移植类中有 4 个 ContentPage 页面A 页面B 页面C 第D页
页面a到页面b自带
Navigation.InsertPageBefore(new PageB(),this);
await Navigation.PopAsync();
从页面 b 到页面 c 从代码重定向
Navigation.InsertPageBefore(new PageC(),this);
await Navigation.PopAsync();
从页面 C 到页面 D 从代码重定向
Navigation.InsertPageBefore(new PageD(),this);
await Navigation.PopAsync();
现在我想将用户从 PageD 重定向到 PageB
Navigation.InsertPageBefore(new PageB(),this);
await Navigation.PopAsync();
我可以很顺利地从PageA 到PageD。但是试图从 PageD 返回到 PageB 我得到了一个异常
错误 before 必须在当前上下文的推送堆栈中
堆栈跟踪
在 Xamarin.Forms.Internals.NavigationProxy.OnInsertPageBefore (Xamarin.Forms.Page 页面,Xamarin.Forms.Page 之前)[0x00020] in D:\agent_work\1\s\Xamarin.Forms.Core\NavigationProxy.cs:150 在 Xamarin.Forms.Internals.NavigationProxy.InsertPageBefore (Xamarin.Forms.Page 页面,Xamarin.Forms.Page 之前)[0x00000] in D:\agent_work\1\s\Xamarin.Forms.Core\NavigationProxy.cs:59 在 Test.PageD+d__9.MoveNext() [0x0007a] in E:\Projects\xamrine\Source\TestiOS\PictureAfterSignature.xaml.cs:433
我该如何解决这个问题?
【问题讨论】:
标签: c# xamarin.forms xamarin.ios