UILabel and UITextView line breaks don't match

前端 未结 1 1253
长情又很酷
长情又很酷 2021-01-05 17:33

I have a UILabel and a UITextView, where my intention is for them both to display the same text, and for the appearance to be the same. I\'m having some issue with that righ

相关标签:
1条回答
  • 2021-01-05 17:46

    It was a change to UILabel in IOS 11 to fix orphaned words. No way to shut it off although I wish there was. The only way to do it would be to use a non editable/nonscrollable textview or a CATextLayer. To get the sizing attributes of a UILabel I am afraid you have to do that manually.

    See this as the problem was similar. Although not in that answer I did find that UITextView wraps the old way. I am using a UITextView now and I manually adjust the font size in textDidChange. I hold the original font so I can always resize.

    0 讨论(0)
提交回复
热议问题