2

I am using a UIDynamicAnimator's UISnapBehavior to animate these circles between two states: http://cl.ly/image/1G3p1B2x2v14/Image%202013.09.24%2011%3A35%3A43%20AM.png

That works great. However, I then put this inside a UIScrollView. When I scroll before the UISnapBehavior animation has "settled" (there seems to be a delay after it looks like it finishes and when it actually finishes), the circles lose their relative positioning to the scroll container: http://cl.ly/image/1E0I3l460J1V/Image%202013.09.24%2011%3A32%3A10%20AM.png

When I scroll after waiting a few seconds after the animation has "settled", the circles do not lose their relative positioning

I'm assuming this is because UISnapBehavior animates things with fixed positions, and then reverts back to relative positioning after it finishes, but I'm not sure if that's true.

4

2 回答 2

2

I was setting the UIDynamicAnimator on a UIView containing the UIScrollView. Setting the UIDynamicAnimator initWithTarget to the UIScrollView seems to have fixed it.

于 2013-09-25T01:19:27.167 回答
1

Try putting your circles within a UIView that's a subview of a UIScrollView instead of in the scroll view itself. I've seen it do some weird things before.

于 2013-09-24T15:40:56.663 回答