Can we use a font in iOS 6 if it's not included in iOS 5?
I would like to use the font "Avenir" which is included in iOS 6. Does that mean a device running iOS 5 won't be able to see the font? If so, is there a way to fallback on a different font if "Avenir" isn't available on their device?
You can choose the font you want to be used in iOS < 6 and assign it if necessary. Define a macro like this:
#define SYSTEM_VERSION_LESS_THAN(v)
([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
and then you can do in your code:
NSString *fontName = @"Avenir";
if SYSTEM_VERSION_LESS_THAN(6.0) {
fontName = @"ArialMT";
}
You can find a list of supported fonts here: http://iosfonts.com/
链接地址: http://www.djcxy.com/p/66258.html