3

How to change the position of the navigation bar title in Xamarin.Forms.

What i get in default is:

enter image description here

What i want is:

enter image description here

How can i do this in Xamarin.Forms?

Mohamad Mahmoud Darwish
  • 3,865
  • 9
  • 51
  • 76

1 Answers1

0

If you are using a Xamarin.forms app based on Shell then you can easily achieve this using Shell.TitleView, define your title content, bind it or even style it as you like.

Inside your ContentPage:

<Shell.TitleView>
    <Label Text="Your Title" HorizontalTextAlignment="Center" HorizontalOptions="CenterAndExpand"/>
</Shell.TitleView>

You will avoid you to use a custom renderer.

Also if you need to apply some special platform-dependent adjustments you can use OnPlatform.

Cfun
  • 8,442
  • 4
  • 30
  • 62