Xamarin.forms Xamarin表单:如何将contentPage工具栏图像与中心对齐?

Xamarin.forms Xamarin表单:如何将contentPage工具栏图像与中心对齐?,xamarin.forms,toolbar,center,Xamarin.forms,Toolbar,Center,我已经用下面的代码在工具栏上添加了一个图标,但是我怎样才能将它对齐到中心呢。现在它在右端。在线程中,这在xamarin形式中是不可能的 <ContentPage.ToolbarItems> <ToolbarItem Icon="logo-final.jpg"/> </ContentPage.ToolbarItems> 我需要在中央的图标,如下面的屏幕 请为此功能建议解决方案?您应该尝试导航标题视图 <ContentPa

我已经用下面的代码在工具栏上添加了一个图标,但是我怎样才能将它对齐到中心呢。现在它在右端。在线程中,这在xamarin形式中是不可能的

<ContentPage.ToolbarItems>
    <ToolbarItem Icon="logo-final.jpg"/>
</ContentPage.ToolbarItems>

我需要在中央的图标,如下面的屏幕


请为此功能建议解决方案?

您应该尝试导航标题视图

<ContentPage>
    <NavigationPage.TitleView>
        <StackLayout Orientation="Horizontal" VerticalOptions="Center" Spacing="10">
            <Image Source="iconXamagon.png">               
            </Image>           
        </StackLayout>
    </NavigationPage.TitleView>
    ...
</ContentPage>

...

更多参考资料

嗨,你解决了这个问题吗?@JuniorJiang MSFT Ya solved