gpt4 book ai didi

xamarin - 系统无效操作异常: PushAsync is not supported globally on Android

转载 作者:行者123 更新时间:2023-12-02 03:42:35 25 4
gpt4 key购买 nike

我正在关注此 Xamarin Forms quick start guide (多屏的)

但是当我尝试运行已完成的程序时出现此错误

System.InvalidOperationException: PushAsync is not supported globally on Android, please use a NavigationPage

没有将“NavigationPage”添加到共享库项目的选项。

有什么想法吗?我使用的是 Visual Studio 15.5.2 和所有最新版本,包括 Windows 10。

注意:在本指南中,步骤 4 不再与 Visual studio 匹配 enter image description here

不再有跨平台 > 表单 Xaml 页面,而是已替换为这些选项

enter image description here

最佳答案

在您的 Application 子类中(如果由模板创建,通常在 App.csApp.xaml.cs 文件中),包装您的NavigationPage 页面中的第一页,现在您将能够推送和弹出页面。

示例:

MainPage = new YourFirstPage(); 

将其包装在 NavigationPage

MainPage = new NavigationPage(new YourFirstPage());

关于xamarin - 系统无效操作异常: PushAsync is not supported globally on Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48070606/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com