0

I have some UILabel that contains a couple of different fonts, which I apply via attributedText.

I have set the lineBreakMode to be UILineBreakModeWordWrap and I have set the size of the UILabel to be the sizeThatFits

And it looks just fine, until I add NSBaselineOffsetAttributeName to it's attributedText

Then I see weird truncation, regardless of how I change the height or width of the UILabel

How do I alter the baseline without affecting truncation?

BananaNeil
  • 10,322
  • 7
  • 46
  • 66
  • Possible duplicate of [iOS Why do NSTextAttachment disappear when setting NSBaselineOffsetAttributeName?](http://stackoverflow.com/questions/25785257/ios-why-do-nstextattachment-disappear-when-setting-nsbaselineoffsetattributename) – Andrei Aug 26 '16 at 12:25

1 Answers1

0

I took the advice from the post, iOS Why do NSTextAttachment disappear when setting NSBaselineOffsetAttributeName?

and added a new NSMutableParagraphStyle to the the UILabel's attributedText with it's minimumLineHeight set to be the font's size plus the added baseline, and I got the results I was looking for.

Community
  • 1
  • 1
BananaNeil
  • 10,322
  • 7
  • 46
  • 66