How do I size a UITextView to its content on iOS 7?

前端 未结 13 1701
伪装坚强ぢ
伪装坚强ぢ 2020-11-28 03:04

I\'ve been using the accepted answer here for years.

On iOS 7, the contentSize.height becomes the frame.height-8, regardless of text content.

What\'s a worki

相关标签:
13条回答
  • 2020-11-28 04:01

    In storyboard, if using constraints, make sure you are constrained to your superview in the 'ruler' tab of the right-hand pane on xcode for the UITextView. My problem was that I had a constraint of -80 pts on the 'Trailing space to'.

    enter image description here

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