How can i have a UILabel with two different colors for the font? I will have text in two different strings and i want to make text with first string as red and second as green. The length of both the string is variable.
How can i have a UILabel with two different colors for the font? I
Share
You can’t do this within a
UILabels. But my suggestion is that instead of using multipleUILabeljust concentrate onNSAttributedString. FindUIControllersthat drawNSAttributedStringbecauseUILabel,UITextViewdo not supportNSAttributedString.PS: if you plan to distribute an iOS6 or later application, as UILabel now support NSAttributedString, you should use UILabel directly instead of OHAttributedLabel as it is now natively supported by the OS.