Navigation.PushAsync(new Page()) is not working for some pages in Xamarin.Forms

三世轮回 提交于 2019-12-11 04:53:15

问题


I am using Xamarin.Forms and trying to implement an app with Navigation. I Created a Xamarin.Forms shared project solution and added my first two pages. They work correctly and so does the navigation. I added another page and linked them up the same way as the first two and it does not work. I click the button to navigate to the view and nothing happens.

I wire up both of the views like such

btnPurchase.Clicked += (s, e) => this.Navigation.PushAsync(new PurchasePage());
btnContactUs.Clicked += (s, e) => this.Navigation.PushAsync(new ContactUsPage());

After wiring up the click event I add both buttons as children in my stacklayout.

Both buttons show up in the view. However, the btnContactUs button is the only one that gets pushed onto the navigation stack.

Any ideas?


回答1:


I figured it out.

I had changed the Name of my SharedProject in which it removed the reference from my iOS and Android project. Surprisingly I did not receive any reference errors until I did a clean / rebuild. Once I hooked up the shared project again, the navigation worked correctly.



来源:https://stackoverflow.com/questions/24007226/navigation-pushasyncnew-page-is-not-working-for-some-pages-in-xamarin-forms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!