1

Im trying to make a dynamic UIScrollView, using this answer I could make it work Calculating contentSize for UIScrollView when using Auto Layout

These are my label constraints: enter image description here

The scroll is working, but since I have the bottom constraint the view will always have the huge space in the bottom. But if I remove the bottom constraint the scroll will not work. How can I keep the constraint but at the same time don't have all this huge space? Is this possible?

Community
  • 1
  • 1
Adrian
  • 313
  • 2
  • 3
  • 16

2 Answers2

2

The solution was to make the view inside the scroll view to have the same height as the label so i don't have that huge bottom constrain, doing that solved my problem since the new bottom constrain is now 8 instead of 595.

Adrian
  • 313
  • 2
  • 3
  • 16
0

To get the same size and location of the picture, I suggest to delete the "595" Bottom Space constraint and instead set a height constraint on the UILabel. This will get rid of all that huge space.

Mochi
  • 599
  • 4
  • 22
  • Ok i got the height using this answer (http://stackoverflow.com/a/34430402/6027418) but now the scrollview doesn't work again because of the lack of the bottom space constrain. – Adrian Jan 17 '17 at 14:31
  • What are your constraints on your scroll view? – Mochi Jan 17 '17 at 16:06
  • Solved my problem, maybe its no the best way but it solved anyway. Thanks for the help, Mochi. – Adrian Jan 17 '17 at 21:51