Yimin Rong
Yimin Rong

Reputation: 2027

iOS UIScrollView fine tuning

In Apple's apps I notice the scrolling is perfect. Everything moves nicely and when you stop, it stops. You can have a huge image and move directly to any spot and it stays there.

I'd like to provide the same UE, but for my apps, if the content exceeds the size of the scroll view (as it should - otherwise what's the point in having a scroll view?) the scroll view never stays put, you have to drag to see content on the edges, then it bounces back and hides it again. Very annoying, especially if there is active content like a button there.

I'm not an iOS expert, e.g. I just found out recently about how critical viewWillAppear is w.r.t. UIScrollView. Is there a concise reference somewhere on how to get perfect rock solid scrolling? (i.e. not Apple's Dev docs!)

Thanks for reading,

Yimin

Upvotes: 0

Views: 141

Answers (2)

Yimin Rong
Yimin Rong

Reputation: 2027

Apple has access to internals which we don't so its products tend to perform better. Scrolling in iOS is basically take it or leave it. Have followed the guidelines in the tutorials and they all have flakey scrolling, in particular the edges aren't always visible when zoomed.

Upvotes: 0

jjv360
jjv360

Reputation: 4140

Are you setting the contentSize property on the UIScrollView?

scrollView.contentSize = CGSizeMake(2000, 2000);

Upvotes: 1

Related Questions