Xamarin TabbedPage不显示在WPF上的图标

我有一个在android和wpf中实现选项卡式页面的应用程序。无论如何,它在每个选项卡上都有一个图标,对于android来说工作正常,但在wpf中,它仅显示选项卡的标题,但不显示图标。我已经尝试添加标题图标大小和属性窗口:标签页。 HeaderIconsEnabled =“ true”。在wpf项目中,我的图标图像位于rootfolder中。

screenshot android

screenshot wpf

    <?xml version="1.0" encoding="utf-8" ?>
    <TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                xmlns:local="clr-namespace:SignUpEwise.Pages"
                x:Class="SignUpEwise.Pages.MainTab"
                NavigationPage.HasBackButton="False"
                xmlns:windows="clr-namespace:Xamarin.Forms.PlatformConfiguration.Windowsspecific;assembly=Xamarin.Forms.Core"
                windows:TabbedPage.HeaderIconsEnabled="true">
<windows:TabbedPage.HeaderIconsSize>
        <Size>
            <x:Arguments>
                <x:Double>24</x:Double>
                <x:Double>24</x:Double>
            </x:Arguments>
        </Size>
    </windows:TabbedPage.HeaderIconsSize>
    <NavigationPage Title="Personal" Icon="Personal.png">
            <x:Arguments>
                <local:PersonalDataPage />
            </x:Arguments>
    </NavigationPage>
    <NavigationPage Title="Dieccion" Icon="Domicilio.png">
            <x:Arguments>
                <local:Adresspage />
            </x:Arguments>
    </NavigationPage>
    <NavigationPage Title="Contacto" Icon="contacto.png">
          <x:Arguments>
            <local:Contact />
          </x:Arguments>
    </NavigationPage>
    <NavigationPage Title="Foto" Icon="camara.png">
          <x:Arguments>
             <local:Picture />
          </x:Arguments>
    </NavigationPage>

</TabbedPage>

C#类

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.Windowsspecific;
using Xamarin.Forms.Xaml;

namespace SignUpEwise.Pages
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class MainTab : Xamarin.Forms.TabbedPage
    {
        public MainTab ()
        {
            NavigationPage.SetHasnavigationBar(this,false);
            //On<Windows>().SetHeaderIconsEnabled(true);
            //On<Windows>().SetHeaderIconsSize(new Size(24,24));
            InitializeComponent();

        }
    }
}
yunafangzxcv 回答:Xamarin TabbedPage不显示在WPF上的图标

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3109061.html

大家都在问