0

I am having trouble getting the text in the label to appear in at the top and for some reason my UIScrollView will not go all the way to last point (i.e. 10). It stops at 7. I have added some images to explain what I mean.

Currently the text is in the middle, but want it at the top of the label not in the middle

Lots of space between Terms and Conditions and the text

I can only scroll to half of point 7 and view that, but there are 10 points

enter image description here

Babz
  • 97
  • 1
  • 7
  • You can shrink the size of `textView` to fit to content size. Why do you want to add `UILabel` on `UIScrollView` instead of using just `UITextView`? – Ryan Nov 22 '16 at 18:29

2 Answers2

1

This should not be a label. It should be a non-editable text view (UITextView). Then the problem would not arise.

In effect, a non-editable text view is a scrollable label!

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • thank you. Follow-up question - if I wanted to make a combination of images and text (like a sentence here or there) I would have to use UIScrollView, right? Sometimes there autolayout issues, so would it be better to: 1) create a ViewController then on top of that UIScrollView and then View and then put my labels and images on the view OR 2) create a ViewController then on top of that UIScrollView and then put my labels and images on the UIScrollView (i.e. no View added in this one) – Babz Nov 22 '16 at 21:30
  • That is unrelated. Ask a whole new question! – matt Nov 22 '16 at 21:35
0

Change your bottom layout constraint relation of UILabel to bottom margin as Greater than Equal then your problem will be solve, even no need to apply textview.

Change the content hugging priority vertical to 751 then it will maintain its position in the scrollview and will increase the scrollview's contentSize.height dynamically.

Subhajit Halder
  • 1,427
  • 13
  • 21