2016-11-04 53 views
0

在从Xamarin网站的代码示例中,详细信息页面加入到NavigationPageXamarin形式:MasterDetailPage:是否详细页必须NavigationPage作为标准

Detail = new NavigationPage(new TestPage()); 

不TestPage必须由NavigationPage被包裹?如果我移除了NavigationPage并且只放了new TestPage(),它将对我有用。如果我保留导航页面,我有我在这里发布的错误。

Reference from my other post

如果没有NavigationPage,汉堡包图标都会消失,即使仍然能够显示母版页。

回答

0

From official Xamarin documentation:

Public Constructors 

NavigationPage() 
Initializes a new NavigationPage object. 

NavigationPage(Page) 
Creates a new NavigationPage element with root as its root element. 

所以,你只需要/想/有一个页面传递作为参数,如果你想指定它的根元素。

而且万一你发展与MasterDetailPage的UWP应用程序,你应该记住:

Generally, you'll set these two properties to objects of type ContentPage, but currently, to get MasterDetailPage to work on the Universal Windows Platform, the detail page must be a NavigationPage.

相关问题