简体   繁体   中英

Custom Font not showing in Xamarin Storyboard

For my iOS project i need to use custom fonts. I added fonts in Resources/Fonts folder. And register the fonts in Info.plist like this. In storyboard i am getting custom fonts like this but the fonts not affecting in design. The font style drop down always empty see here "www.tiikoni.com/tis/view/?id=1f07d04". I m working in .storyboard file not .xib

What have i done wrong?

Xamarin studio version - 5.10.3

Fonts used - Exo-SemiBold.ttf, Montserrat-Bold.ttf

Ran into a similar problem. My custom fonts didn´t show up in Xcode at all.

Solution was to move fonts from /Resources/Fonts/ up to /Resources/ (And updating Info.plist accordingly). Doing so made them show up in Xcode.

Try setting font programmatically.

After adding reference of your Font file in plist using "Fonts provided by application" key.

Then Log available fonts in AppDelegate method like this

NSArray *fontFamilies = [UIFont familyNames];

for (int i = 0; i < [fontFamilies count]; i++)
{
    NSString *fontFamily = [fontFamilies objectAtIndex:i];
    NSArray *fontNames = [UIFont fontNamesForFamilyName:[fontFamilies objectAtIndex:i]];
    NSLog (@"%@: %@", fontFamily, fontNames);
}

In these logs you can find exact name of the font you want to apply.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM