Prism 为 Xamarin.Forms 开发的 iOS 上未显示汉堡包图标
Hamburger icon not showing on iOS developed by Prism for Xamarin.Forms
下面是我的 MasterDetailPage 的 XAML 页面:
<MasterDetailPage 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:b="clr-namespace:Prism.Behaviors;assembly=Prism.Forms"
mc:Ignorable="d"
x:Class="JapaneseLearnPrism.Views.MenuPage">
<MasterDetailPage.Master>
<NavigationPage Title="Menu" Icon="ic_hamburger.png">
<x:Arguments>
<ContentPage Title="{Binding Title}">
<!--Content for my menus here.-->
</ContentPage>
</x:Arguments>
</NavigationPage>
</MasterDetailPage.Master>
</MasterDetailPage>
这就是我为 Prism 设置页面路径的方式:
protected override async void OnInitialized()
{
InitializeComponent();
Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Application.SetWindowSoftInputModeAdjust(this, Xamarin.Forms.PlatformConfiguration.AndroidSpecific.WindowSoftInputModeAdjust.Resize);
// await NavigationService.NavigateAsync("NavigationPage/MainPage");
await NavigationService.NavigateAsync(nameof(MenuPage) + "/" + nameof(NavigationPage) + "/" + nameof(Views.MainPage));
}
这对于 MD 页面功能来说效果很好。汉堡包图标正确显示在 Android 中,但不是 iOS。我想知道为什么。我在网上搜索了所有人,但实际上没有解决。
希望能在这里得到答案。
谢谢。
使用 MasterDetailPage 中的 IconImageSource 来显示 HamburgerIcon 就 Android 而言,它使用默认的汉堡图标,这就是它显示在 Android 而不是 iOS 中的原因。
<MasterDetailPage 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:b="clr-namespace:Prism.Behaviors;assembly=Prism.Forms"
mc:Ignorable="d"
IconImageSource="ic_hamburger.png"
x:Class="JapaneseLearnPrism.Views.MenuPage">
下面是我的 MasterDetailPage 的 XAML 页面:
<MasterDetailPage 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:b="clr-namespace:Prism.Behaviors;assembly=Prism.Forms"
mc:Ignorable="d"
x:Class="JapaneseLearnPrism.Views.MenuPage">
<MasterDetailPage.Master>
<NavigationPage Title="Menu" Icon="ic_hamburger.png">
<x:Arguments>
<ContentPage Title="{Binding Title}">
<!--Content for my menus here.-->
</ContentPage>
</x:Arguments>
</NavigationPage>
</MasterDetailPage.Master>
</MasterDetailPage>
这就是我为 Prism 设置页面路径的方式:
protected override async void OnInitialized()
{
InitializeComponent();
Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Application.SetWindowSoftInputModeAdjust(this, Xamarin.Forms.PlatformConfiguration.AndroidSpecific.WindowSoftInputModeAdjust.Resize);
// await NavigationService.NavigateAsync("NavigationPage/MainPage");
await NavigationService.NavigateAsync(nameof(MenuPage) + "/" + nameof(NavigationPage) + "/" + nameof(Views.MainPage));
}
这对于 MD 页面功能来说效果很好。汉堡包图标正确显示在 Android 中,但不是 iOS。我想知道为什么。我在网上搜索了所有人,但实际上没有解决。 希望能在这里得到答案。
谢谢。
使用 MasterDetailPage 中的 IconImageSource 来显示 HamburgerIcon 就 Android 而言,它使用默认的汉堡图标,这就是它显示在 Android 而不是 iOS 中的原因。
<MasterDetailPage 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:b="clr-namespace:Prism.Behaviors;assembly=Prism.Forms"
mc:Ignorable="d"
IconImageSource="ic_hamburger.png"
x:Class="JapaneseLearnPrism.Views.MenuPage">