D
D
Dmitry2014-10-10 14:43:11
iOS
Dmitry, 2014-10-10 14:43:11

UILabel with dynamic height but no width inside UIScrollView - how to make it work?

The task, in general, is simple.
1) there is a UIScrollView that occupies the entire screen.
2) there are some components inside it, closer to the bottom (not the last one) it contains a UILabel
3) this UILabel should be able to dynamically stretch down, but not to the right
4) UIScrollView should only stretch down, but not to the right
All attempts to implement this have failed . Or UILabel only stretches to the right, or stretches down, but at the same time WordWrapping breaks - each line of the Label does not wrap to a new line, but goes beyond the border. Or in general, UIScrollView is stretched in both dimensions at once, but I only need to go down.
I hope someone already with a similar statement of the problem and knows the solution.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Morozov, 2014-10-11
@morozovdenis

UIScrollView stretches in both dimensions at once

UIScrollView should not drag, contentSize should change
there are two options, either set the width to a much larger one, or numberOfLines is equal to 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question