我嘗試為 .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>
https://imgur.com/a/AitiWWf
我怎樣才能解決這個問題?
uj5u.com熱心網友回復:
這個潛在的問題正在這個執行緒上得到修復和跟蹤:https ://github.com/dotnet/maui/issues/3877
我使用它進行Visual Studio 17.3.5了測驗,其中label的內容TitleView顯示在內容頁面中。
更新:
在您的AppShell.xaml.cs中,將其更改如下:
MainPage = new NavigationPage(new MainPage());
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/524083.html
標籤:。网xml标题毛伊岛
上一篇:MVVM:如果我設定DefaultStyleKeyProperty,自定義TreeViewItem不會顯示在TreeView中
