I have created a .xib file and have added a UILabel
with attributed text. The contents of the label consists of 2 words - one is in regular font while the other word is bold.
The interface builder shows the label correctly as follows
However, when the app is run on the simulator, the following is shown-
Can anyone point out why this is happening?
Seeing as it works with a system font such as Arial, it is probably a problem with the custom font not being recognised. Try the following:
Did you add the custom fonts files to your Xcode project, and to the build target?
Did you add them to the Info.plist
using the UIAppFonts
key? This key should contain an array of the names of the font files you added to your project (e.g. Custom-Font.ttf
)