[英]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.