UILabel attributedText with multiple line break modes

前端 未结 4 2098
时光取名叫无心
时光取名叫无心 2021-02-05 18:35

I have a requirement of showing a UILabel with text that has two different styles (different colours, parts of the text bolded). This is solved easily enough by using the attrib

4条回答
  •  再見小時候
    2021-02-05 19:14

    You can set up an NSParagraphStyle with any lineBreakMode you please, and apply it to the string using NSParagraphStyleAttributeName. I don't know if all of the values of NSLineBreakMode are supported, but I have no reason to believe they aren't.

提交回复
热议问题