Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5 iOS 7 - UIScrollView behaving oddly

When migrating a project from Xcode 4 iOS 6, I noticed the UIScrollView instance is not behaving properly. Sometimes it just seems to be stuck, and only when I pinch in or out to change the scale does it start scrolling properly.

I noticed a few replies in a similar question, along the lines of removing positioning constraints, that I tried (even though I do need the constraints eventually) and it didn't work.

Has anyone encountered this behaviour and found a way to fix it?

like image 678
Yimin Rong Avatar asked Oct 03 '13 17:10

Yimin Rong


1 Answers

I was able to make it work by using

self.automaticallyAdjustsScrollViewInsets = NO;

in the view controller holding the scrollview. Just put it after the scroll view's instantiation.

like image 94
Lv.BeLeCk Avatar answered Oct 18 '22 21:10

Lv.BeLeCk