perrohunter
perrohunter

Reputation: 3526

Manually scrolling a UIView contentOffset

I'm trying to scroll the contents of a UIView using the contentOffset which so far I achieve handling touchesBegan: and touchesMoves: methods of the view, however I get a jumpy effect as I'm changing the bounds of the UIView manually (for example: current position +/- the change of the last position of the finger and the new position)

Is there any easy way to achieve this without manually changing the bounds of the UIView?

IMPORTANT NOTES: I'm not using a UIScrollView because the mentioned UIView has plenty of draggable subviews so if I use a UIScrollView I can't drag because the UIViewScroll scrolling event executes over the subviews events.

Animating the layer of the mentioned UIView causes the contents to move out of control, like if the point of reference had changed somehow.

However I'm always open to suggestions.

Upvotes: 0

Views: 1344

Answers (1)

A-Live
A-Live

Reputation: 8944

I would rather make a UIView container clipping subviews, add the content view which we will drag as a subview and change it's frame. I think it shouldn't have jumpy effect as it must be the same as animating the view frame change.

Upvotes: 1

Related Questions