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.
Try TTTAttributedLabel. It's a subclass of UILabel that supports NSAttributedString
s, which would make it easy to have multiple colors, fonts, and styles in the same string.
Edit: Alternatively, if you don't want the 3rd party dependency and are targeting iOS 6, UILabel
now has the attributedText
property.