1
votes

I want to center align text in navigationbar for Xamarin form-Android. Also would like to change the font size and font family. I tried https://forums.xamarin.com/discussion/59722/toolbar-title-set-center-align but not working for PCL.

Anyone got a solution for this.

1

1 Answers

-1
votes

You could achieve the fontsize and font by creating a custom renderer for navigation page. For the center align I'm not sure how to achieve that since you can only call the toolbar and textbox is inside the toolbar (try giving padding maybe?).

For fontsize / font on IOS:

public class CustomNavigationBarRenderer : NavigationRenderer
{
 public override void ViewDidLoad()
 {
    base.ViewDidLoad();

    this.NavigationBar.TitleTextAttributes=new UIStringAttributes()
    {
        Font = UIFont.FromName("font",fontsize)
    };

 }
}