【发布时间】:2022-11-10 10:28:21
【问题描述】:
我尝试为 .net maui android 应用程序创建标题图像,但标题不可见。即使我使用标签进行更改,结果也相同:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ChapsPizza.Views.MainPage"
xmlns:vm="clr-namespace:ChapsPizza.ViewModels"
Title="Test">
<NavigationPage.TitleView>
<Label Text="Test" TextColor="Black"/>
<!--<Image Source="logo.png" Background="Orange"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
HeightRequest="40" WidthRequest="40"/>-->
</NavigationPage.TitleView>
<ContentPage.BindingContext>
<vm:MainPageViewModel/>
</ContentPage.BindingContext>
我怎样才能解决这个问题?
【问题讨论】:
-
你如何导航到这个页面你能告诉我吗
-
它是主页,如果我在 TitleView 之外创建另一个标签,我会看到它
-
我可以知道你的 Visual Studio 版本是什么吗?您需要至少更新到
17.3.5。