Forum Xamarin.Forms

How can I make my navigation bar text bold?

Dear experts,

I have a Master-Detail architecture, and I need to make the detail page's title text of the navigation bar bold. How can I do that the simplest way?

Here is some of my code:

        private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
            var item = e.SelectedItem as MainMDPageMenuItem;
            if (item == null)

            item.ItemBorderColor = Color.Red; // Make a red frame around the selected item
            if (PreviouslySelectedItem != null)
                PreviouslySelectedItem.ItemBorderColor = Color.FromHex("#00a8d5"); // Return the original color to the previously selected (now deselected) item

            var page = (Page)Activator.CreateInstance(item.TargetType);
            page.Title = item.Title; // THIS IS THE TITLE I AM TALKING ABOUT

            Detail = new NavigationPage(page);
            IsPresented = false;

            MasterPage.ListView.SelectedItem = null;

            PreviouslySelectedItem = item;


Best Answer


  • YorkGoYorkGo CNMember, Xamarin Team Xamurai

    For Android part, you could implement this feature by add the following in your Resources\values\styles.xml file:

    <style name="ActionBar.nameText" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
        <item name="android:textSize">58sp</item> <-- Could delete this line
        <item name="android:textStyle">bold</item>

    Then, add it in your Resources\layout\Toolbar.axml:

  • dpreznikdpreznik Member ✭✭

    @YorkGo said:
    For Android part, you could implement this feature by add the following in your Resources\values\styles.xml file:

    Thank you for your answer. But I don't use Android, I use UWP.

  • dpreznikdpreznik Member ✭✭
    edited December 2018

    @JamesLavery said:
    Can't you use a TitleView for the page? A TitleView allows you to specify the content of the page's navigation header.

    I'm not sure how it works with MasterDetail page's though.

    Yes, this works! Thanks! I use it like this:

                var page = (Page)Activator.CreateInstance(item.TargetType);
                var titleView = new Label
                    Text = item.Title,
                    FontAttributes = FontAttributes.Bold,
                    TextColor = Color.White,
                    BackgroundColor = Color.FromHex("#00a8d5")
                NavigationPage.SetTitleView(page, titleView);
Sign In or Register to comment.