0
votes

In my view I have a scrollview. In my scrollview I have a UILabel.

I use constraints to set my scrollview in my superview and also for my UILabel.

If I set a long text inside my UILabel the scrollview's content extends to the width of my UILabel. Instead of that, I would like the content view set to maximum width of my screen and the UILabel goes to multilines.

How can I do this ?

1

1 Answers

1
votes

Try setting your label's number of line to 0 and preferredMaxLayoutWidth the width you want, then call setNeedsLayout with your main view.