UILabel Text with Multiple Font Colors

前端 未结 8 647
一向
一向 2020-12-19 18:48

Is there a way to have the textColor property of a UILabel be two different UIColors? Basically I\'m trying to make the first characte

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-19 19:24

    UILabel doesnot supprt this property...

    Use should use NSAttributedString... and use controllers for drawing NSAttributesString...

    Controller for NSAttributedString

    UPDATE:

    From iOS 6 you can do the following :

    label.attributedText = attributedString;
    

提交回复
热议问题