Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Set application-wide font family

JeffRushJeffRush USMember ✭✭✭

I want to set the font family globally, but I want the font sizing to be dynamic. This is easy to do in Xamarin.Forms, but what about .iOS? If it can't be done application-wide, can it at least be done at the view level?

Tagged:

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    You could create a subclass of UILabel , change its font family and use this control anywhere you want .

     public class MyLabel : UILabel
        {
            public override void DrawText(CGRect rect)
            {
                base.DrawText(rect);
    
                this.Font = UIFont.FromName("xxx",20);
            }
        }
    
Sign In or Register to comment.