BYZZav
BYZZav

Reputation: 1478

UIScrollView Odd Scrolling

Im getting this very odd behaviour with my scroll view. Its a paging scroll view set up in iOS 8 using auto layout. The screen so far is very simple, just some labels and a scroll view. There are three pages.

The set up is a 'container view' in which a scroll view sits. The scroll view contains a content view which gets it size from the container and its width is 3 times the size of the container view, giving a scroll view with 3 pages of content the size of the container view.

Bounce is off, paging is on.

enter image description here

The scrolling doesn't seem "choppy" - I've experienced this with UITableView before and I know what scrolling looks like when the phone is struggling to produce a good frame rate, I don't think its like that.

Its almost like the whole scroll view is stuck in treacle. Or as if someone added some UIDynamics or some kind of spring behaviour to the scroll view at the ends of the scrolling as its about to page its unusually slow, no matter the intensity of 'flick' to scroll.

Ive attached a video to show you what I mean. Ive reproduced this on all devices on the simulator and on the iP6+/iP5s devices.

Video: http://tinypic.com/player.php?v=v5jy4p%3E&s=8#.VJljyr0CkA

Is that scrolling abnormal? What do you think the problem is?

Upvotes: 1

Views: 160

Answers (1)

BYZZav
BYZZav

Reputation: 1478

The problem was that I was using a Freeform UIViewController of 1800 x 600 - so I could layout my content in interface builder (3 pages). Reverting back to 600 x 600 restores the normal scrolling. I don't know why this should happen since the whole point of autolayout is to not be affected to these changes in size and my view controller is totally adaptive...but there we are.

This is the approach I'm using: UIScrollView Paging Autolayout & Storyboard - its very useful, but be aware to restore your view controllers to a reasonable size before you compile otherwise you get odd scrolling!

Upvotes: 1

Related Questions