简体   繁体   English

汉堡图标未显示在由 Prism 为 Xamarin.Forms 开发的 iOS 上

[英]Hamburger icon not showing on iOS developed by Prism for Xamarin.Forms

Below is my XAML page for my MasterDetailPage:下面是我的 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>

And this is how I set up the Page Path for Prism:这就是我为 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));
}

This is works fine for the MD page function.这适用于 MD 页面功能。 And the hamburger icon is correctly showing in Android but not iOS.并且汉堡包图标在 Android 中正确显示,但在 iOS 中未正确显示。 I am wondering why.我想知道为什么。 I searched online everyone but actually nothing solved.我在网上搜索了所有人,但实际上没有解决。 Hope be able to get the answer here.希望能在这里得到答案。

Thanks.谢谢。

Use IconImageSource inside MasterDetailPage to display HamburgerIcon as far as Android is concern it uses it's default hamburger Icon that's why it is showing in Android and not in 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">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM