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