Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

ScrollView In Autolayout

I've encountered some problems with scrollview keeping autolayout on. Do you have any hint to make a scrollview containing (n°) imageviews (one below the other) with storyboard ?

3 Answers

Is your scroll view on top of the image views?

I've a view controller embedded in a navigation controller: In the view controller I've :

  • View
    • Scroll View
      • view
        • (n) image views
Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

Can you please describe the problem? Pasting code would help too.

The problem is essentially that it doesn't scroll if autolayout is enabled on the storyboard. I've no code, i was trying to implemet it only with storyboard, is it possible or i need to code ?

Thx for the reply

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

Try selecting the ScrollView in the Storyboard and add missing constraints using the Auto Layout icons to the bottom right.

Thanks, it worked very well!

It looks like you have an extra view there. You can take out the extra view and pin the image views to the scroll views.

Thx, I'll try