简体   繁体   English

CS1729“MyNavigationPage”不包含带 1 个参数的构造函数 --> 在 Visual Studio 2019 社区版中

[英]CS1729 'MyNavigationPage' does not contain a constructor that takes 1 arguments --> in visual studio 2019 community edition

I am trying to add a navigation bar in Xamarin.forms我正在尝试在 Xamarin.forms 中添加导航栏

    public App()
    {
        InitializeComponent();
        MainPage = new MyNavigationPage(new MyNavigationPage());
    }

I am getting this error --> 'MyNavigationPage' does not contain a constructor that takes 1 argument我收到此错误 -->“MyNavigationPage”不包含采用 1 个参数的构造函数

I have tried adding a constructor but then the navigation bar does not appear.我试过添加一个构造函数,但导航栏没有出现。

The answer was, we have to use the pre-build method "NavigationPage" instead of your own created page ie in my cast MyNavigationPage答案是,我们必须使用预构建方法“NavigationPage”而不是您自己创建的页面,即在我的演员 MyNavigationPage 中

new NavigationPage(new MyNavigationPage());新导航页面(新我的导航页面());

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 :错误CS1729:&#39;SQLiteConnection&#39;不包含带有1个参数的构造函数(CS1729) - : Error CS1729: 'SQLiteConnection' does not contain a constructor that takes 1 arguments (CS1729) 错误CS1729:类型&#39;ARSoft.Tools.Net.Dns.DnsServer&#39;不包含带有&#39;4&#39;参数的构造函数 - error CS1729: The type `ARSoft.Tools.Net.Dns.DnsServer' does not contain a constructor that takes `4' arguments 错误CS1729:类型为System.Collections.Generic.List <string> &#39;不包含采用`5&#39;参数的构造函数 - Error CS1729: The type `System.Collections.Generic.List<string>' does not contain a constructor that takes `5' arguments Blazor 枚举范围,CS1729 'RangeAttribute' 不包含采用 4 arguments 的构造函数 - Blazor Enum range, CS1729 'RangeAttribute' does not contain a constructor that takes 4 arguments 错误CS1729:类型&#39;UnityEngine.Rect&#39;不包含带有&#39;5&#39;参数的构造函数 - error CS1729: The type `UnityEngine.Rect' does not contain a constructor that takes `5' arguments asp.net代码显示编译器错误消息:CS1729:“ EmailReader.Pop3Client”不包含带有0个参数的构造函数 - asp.net code displays Compiler Error Message: CS1729: 'EmailReader.Pop3Client' does not contain a constructor that takes 0 arguments 如何清除CS0029 C#无法将类型&#39;void&#39;隐式转换为&#39;int&#39;,并且CS1729 C#&#39;Car&#39;不包含采用4个参数的构造函数 - How to clear CS0029 C# Cannot implicitly convert type 'void' to 'int' and CS1729 C# 'Car' does not contain a constructor that takes 4 arguments Visual Studio 2019 社区版是否支持 MVC 5 项目? - Does Visual Studio 2019 community edition support MVC 5 projects? 构造函数可访问性 C# 编译器错误 CS0122 vs CS1729 - Constructor accessibility C# compiler error CS0122 vs CS1729 不包含接受1个参数的构造方法 - Does Not Contain A Constructor That Takes 1 Arguments
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM