UITextview inside UIStackView

user2526811 picture user2526811 · May 30, 2016 · Viewed 12.1k times · Source

I added my UITextView inside UIStackView.

But my textview is not Multiline.

Auto layout is shown as below:

enter image description here

As per Image it is just taken 1 line. The textview frame shown as out of frame as per image.

UITextView

enter image description here enter image description here

UIStackView

enter image description here

Answer

Clay Ellis picture Clay Ellis · Sep 19, 2019

As long as your stack view is well-constrained, if you set isScrollEnabled to false on your UITextView, it can size itself within the stack view.