UILabel attributedText with multiple line break modes

前端 未结 4 2107
时光取名叫无心
时光取名叫无心 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:30

    try this:

    [_text drawWithRect:_textRect options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingTruncatesLastVisibleLine attributes:attributes context:nil];

提交回复
热议问题