似乎不支持在模态页面中进行正常导航 [Xamarin.Forms]
Do normal navigation in a Modal page seems to be not supported [Xamarin.Forms]
我曾尝试在模式页面内使用正常导航,但当我导航时显示错误:
PushAsync is not supported on Android, please use NavigationPage
我在模态页面中使用 NavigationPage()
以允许我以正常方式导航,
可能吗?
代码:
导航到模式页面的代码:
await Application.Current.MainPage.Navigation.PushModalAsync(
new NavigationPage(new MyModalPage());
(在模式页面中)
使用正常导航从模态页面导航到 MySecondPage 的代码:
await Application.Current.MainPage.Navigation.PushModalAsync(
new NavigationPage(new MySecondPage()));
然后弹出提到的错误
在您的模态页面中,不要这样做
await Application.Current.MainPage.Navigation.PushModalAsync(
new NavigationPage(new MySecondPage()));
改为这样做
await Navigation.PushAsync(new MySecondPage());
我曾尝试在模式页面内使用正常导航,但当我导航时显示错误:
PushAsync is not supported on Android, please use NavigationPage
我在模态页面中使用 NavigationPage()
以允许我以正常方式导航,
可能吗?
代码:
导航到模式页面的代码:
await Application.Current.MainPage.Navigation.PushModalAsync(
new NavigationPage(new MyModalPage());
(在模式页面中) 使用正常导航从模态页面导航到 MySecondPage 的代码:
await Application.Current.MainPage.Navigation.PushModalAsync(
new NavigationPage(new MySecondPage()));
然后弹出提到的错误
在您的模态页面中,不要这样做
await Application.Current.MainPage.Navigation.PushModalAsync(
new NavigationPage(new MySecondPage()));
改为这样做
await Navigation.PushAsync(new MySecondPage());