UILabel and UITextView draw text with baselineOffset differently

Hello! I have UILabel and UITextView,I've configured it with NSAttributedString
But they draw text differently, if NSAttributedString contains baselineOffset key.
It feels like UILabel counts baselineOffset twice. UILabel moves the baseline and the text itself relative to the baseline, while UITextView's baseline stay on the same place and only the text is moved.

Interesting note: If you apply some attribute not for the whole string UILabel will draw correctly.

Does anyone have any idea why this happens?

Since this question is about Apple-private frameworks, you might have better luck asking over at the Apple Developer Forums, StackOverflow, other Apple-specific development forums. This question is not about open-source Swift.

1 Like
Terms of Service

Privacy Policy

Cookie Policy