问题
I have a UILabel on the storyboard. The default text reads "Label". I then go to the attributes inspector and select the Attributed text style. When I click on the Text field I am presented with several fonts to choose from in a new window. I see that the default text in this case has been set to Helvetica size 17.0. When looking through the fonts presented I decide to use one called ORC A Std. This is part of the fixed width family.
Since I want to use this font, I go back into my attributes inspector and change the word Label to 500. With it highlighted I change the font to ORC A Std.
My text that did read Label (in Helvetica) now reads 500 (in ORC A Std). Excellent. That's what I want. Everything is how I want in the attributes inspector panel.
Unfortunately My label on the storyboard has changed from Label (in Helvetica) to 500 (in Helvetica). Why doesn't it display as the font ORC A std? I then double click directly on the label to change the text to something else. When I click on it to edit it, it shows 500 (in ORC A Std). I change it to say 750 (it's still in ORC A Std). When I'm done editing it, I click off of it and it now reads 750 (in Helvetica).
Why can't I use the font ORC A Std on my label?
回答1:
I think this is a bug, it also happens to me. I read there's tons of bugs regarding attributed text and Xcode and some of them are already fixed on Xcode 5 and iOS7 SDK. To be sure that's going to be taken care of, please report it to Apple.
For now programmatically change the font and that should work.
来源:https://stackoverflow.com/questions/16411198/why-doesnt-the-storyboard-reflect-the-text-attributes-ive-set-to-a-uilabel-usi