2

I have added an icon to the toolbar by the following code, but how can I align it to center. Now it is on the right end. In this thread telling it is not possible in xamarin forms.

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

I need the icon on the center like below screen.

enter image description here

Please suggest a solution for this feature?

Community
  • 1
  • 1
Sreejith Sree
  • 3,055
  • 4
  • 36
  • 105

1 Answers1

2

You should try Navigation Title view

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

For more referance https://montemagno.com/xamarin-forms-icons-in-navigation-toolbar/

Anand
  • 1,866
  • 3
  • 26
  • 49