12

I had a similar question on how to change the font of the title which is here:

How can I change the Font Size and Weight for the Header in a Navigation Page?

Now I have that changed does anyone know how to also change the font size and weight for the top back arrow and the message that goes with it at the top of a navigation page? Seems like these are not part of the title as they have retained the original font size and weight.

ColeX
  • 14,062
  • 5
  • 43
  • 240
Alan2
  • 23,493
  • 79
  • 256
  • 450

1 Answers1

7

I think this issue only occurs on iOS platform, so the solution is

Set UIBarButtonItem Appearance in FinishedLaunching in AppDelegate

UITextAttributes att = new UITextAttributes();
att.Font = UIFont.SystemFontOfSize(20.0 , FontAttributes.Bold); // size and weight

UIBarButtonItem.AppearanceWhenContainedIn(new Type[] { typeof( UINavigationBar) }).SetTitleTextAttributes(att, UIControlState.Normal);
UIBarButtonItem.AppearanceWhenContainedIn(new Type[] { typeof(UINavigationBar) }).SetTitleTextAttributes(att,  UIControlState.Highlighted);
ColeX
  • 14,062
  • 5
  • 43
  • 240
  • Hello Cole, Can you add some more about the "FinishedLaunching" in AppDelegate. I was not even aware there was such a thing. I assume FinishedLaunching is a method but what is AppDelegate? – Alan2 Feb 10 '18 at 12:35
  • @Alan2 AppDelegate.cs is entrance of iOS platform as a class in iOS project . – ColeX Feb 10 '18 at 12:37
  • Xia - Sorry for the long delay in answering. I tried this but it's giving me an error here: UITextAttributes att = new UITextAttributes(); att.Font = UIFont.SystemFontOfSize(20.0, FontAttributes.Bold); // size and weight Cannot convert from double to system nfloat and cannot convert to UIKit.uifontweight – Alan2 Mar 19 '18 at 04:41
  • 1
    @Alan2 change to `UIFont.SystemFontOfSize(20.0f, UIFontWeight.Bold);` – ColeX Mar 19 '18 at 06:30