如何在xamarin.forms上使用xaml在母版详细信息页面中显示页面标题?
我想使用xaml在母版详细信息页面中显示页面标题。我尝试在MasterDetailPage,MasterDetailPage.Master,MasterDetailPage.Details标签中添加x:Name和x:Title属性。但这些都不起作用。以下是xaml:如何在xamarin.forms上使用xaml在母版详细信息页面中显示页面标题?,xaml,xamarin.forms,Xaml,Xamarin.forms,我想使用xaml在母版详细信息页面中显示页面标题。我尝试在MasterDetailPage,MasterDetailPage.Master,MasterDetailPage.Details标签中添加x:Name和x:Title属性。但这些都不起作用。以下是xaml: <?xml version="1.0" encoding="utf-8" ?> <MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
<?xml version="1.0" encoding="utf-8" ?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MSCommunity_Xamarin"
xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
prism:ViewModelLocator.AutowireViewModel="True"
x:Class="PrismUnityApp3.Views.MainPage"
x:Name="Page title">
<MasterDetailPage.Master>
</MasterDetailPage.Master>
<MasterDetailPage.Detail>
</MasterDetailPage.Detail>
页面标题仅显示嵌入
导航页面中的页面,并且正在查找的属性是标题(不是x:title,不是x:Name)
在NP中嵌入MDP没有多大意义。通常的模式是在NavigationPage
中设置一组ContentPage
s(设置Title
),作为MasterDetailPage
的Detail
。MDP是您的应用程序。主页尝试设置内容页title=“菜单”的标题