Custom Font not showing in Xamarin Storyboard

Optimus07Optimus07 INMember
edited March 2016 in Xamarin.iOS

For my iOS project i need to use custom fonts. I added fonts in Resources/Fonts folder. And register the fonts in Info.plist,

In storyboard i am getting custom fonts

but the fonts not affecting in design. The font style drop down always empty like below

What have i done wrong?

I am using Xamarin Studio - 5.10.3 and Fonts - Exo-SemiBold.ttf, Montserrat-Bold.ttf

Answers

  • AlbertoCamilloAlbertoCamillo USMember

    Im having the same issue. Any update?

  • DaveCarsonDaveCarson GBUniversity ✭✭✭
    edited April 2017

    Still an issue with XS 6.3 - although I do get the Custom Fonts listed in most of my XIB files, the LaunchScreen.storyboard doesn't see them.

    With the rogue XIBs I can assign the Font in code but even if I edit the XML of the storyboard it just reverts to the System font which is a pain.

    Edit:
    Further searching I found this post (https://forums.xamarin.com/discussion/34283/using-custom-font-in-launch-screen-storyboard) which could explain the Launch Screen issue - but not the few XIBs that don't see to play well with Custom Fonts.

  • MarcosPerezMarcosPerez USMember

    This is the solution for this issue, add the font for code.

    var firstAttributes = new UIStringAttributes
    {
    ForegroundColor = UIColor.White,
    Font = UIFont.FromName("OpenSans-Semibold", 28f)
    };

            lb_title.AttributedText = new Foundation.NSAttributedString("Relationship Capital Management", firstAttributes);
    

    Regards

  • MarcosPerezMarcosPerez USMember

    For know you can solve the problem adding the font for code. Regards!!!


    var firstAttributes = new UIStringAttributes
    {
    ForegroundColor = UIColor.White,
    Font = UIFont.FromName("OpenSans-Semibold", 28f)
    };

            lb_title.AttributedText = new Foundation.NSAttributedString("Relationship Capital Management", firstAttributes);
    
Sign In or Register to comment.