Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using 'attributed' label text in Interface Builder

I'm attempting to forego using NSAttributedString in my viewController, opting to use the 'Attributed' option (as apposed to 'Plain') in the 'text' field of the attributes inspector for a UILabel.

I've selected the individual words I want to attribute, and have changed their font, this is reflected correctly in the text preview window and on the scenes in IB itself:

enter image description here

However, the simulator does not reflect these changes, it seems as though at runtime the font specified for the attributes is not used (when I change a color, this works as expected). I've added the fonts to my project and to my plist to no avail:

enter image description here

I've found no documentation on this feature and it may very well be similar to the 'text styles' feature in IB (essentially useless for now) - but just wanted to see if anyone had had any luck doing something similar in the past.

Any help or suggestions is much appreciated, thanks.

Edit 03/07/15 Well, I'm pleased to report that this issue is finally resolved in Xcode 7 (still in beta). So we can finally put this issue to rest. Thanks to everyone who tried to figure this out along with me.

like image 873
Kyle G Avatar asked Sep 16 '14 19:09

Kyle G


1 Answers

Try This

In my case when i try to set "Silversky Technology" as Attributed text for label from interface builder its not show when i run in simulator but its show in interface builder. So i used one trick i made Silversky font with 1 pixel bigger then Technology text.

Attribute text have issue with same size of font so change size of 1 word this thing work with me.

May be this is xcode bug but this trick work for me.

like image 55
Jignesh Mayani Avatar answered Sep 22 '22 04:09

Jignesh Mayani