首页 > 解决方案 > Shell标题未在xamarin表单android中显示

问题描述

我的 shell xaml 页面上的标题没有显示,这是我的代码:

<Shell xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:local="clr-namespace:LoanApp2.Views"
             xmlns:bindingVM="clr-namespace:LoanApp2.ViewModel"
             xmlns:contentView="clr-namespace:LoanApp2.ContentViews"
             mc:Ignorable="d"
             Title="Hehehe"
             x:Class="LoanApp2.MainPage" BackgroundColor="#62bef0" >

如您所见,标题已声明但未显示。我也试过:

<Shell.TitleView>
    <Label Text="Hehe"/>
</Shell.TitleView>

但它仍然不起作用。shell 页面由前一个屏幕调用,代码如下Application.Current.MainPage = new MainPage();

标签: c#androidxamarin.formsxamarin.android

解决方案


推荐阅读