1

The context

I am building a UIViewController using Storyboards and AutoLayout.

My ViewController has the following structure:

UIViewController structure

What I did

I have set all the layout constraints for all views inside the UIScrollView properly. So, I have set all the height and vertical distance constraints for all views. I have set all IBOutlets correctly also.

The Problem

When I run it on iOS 6, it works like a charm. But, when running on iOS 7, it doesn't. When I try to scroll the view, I can see the vertical scroll indicator moving down (in a weird way, cause it is getting smaller when I am scrolling down).

Any thoughts about what is happening?

Gustavo Barbosa
  • 1,340
  • 1
  • 17
  • 27
  • Have you read about iOS 7 changes from iOS 6 ? – Wain Oct 03 '13 at 16:05
  • 2
    Yes. I've read. My issue is probably the same reported here (http://stackoverflow.com/questions/18751742/uiscrollview-doesnt-scroll-after-upgrading-to-ios7-xcode-5). But I don't want to remove the autolayout. I saw that it is possible to let the system automatically calculates the scrollview content size based on its constraints. But I don't know why it is happening here. Do you have some link/info/tips to provide? – Gustavo Barbosa Oct 03 '13 at 16:20

1 Answers1

3

Apple posted TN2154 in May 2013, titled "UIScrollView And Autolayout". It probably has the info you need to solve this. It includes both a "Mixed Approach" (i.e. by turning off autolayout constraints for part of the view hierarchy) and a "Pure Auto Layout Approach" which requires declaring additional constraints in code for the scrollview's subviews so they don't depend on the scrollview's size for layout. It's a good read.

cbowns
  • 6,295
  • 5
  • 47
  • 64