开发者

Having a button animate whilst being dragged

I have a开发者_运维百科 button that gets dragged around the screen. Upon moving it above a certain point, it grows in size, but unfortunately because it doesn't auto-update the position as it's animating, it appears stuck for the animation time, and is just jumpy.

Anybody got any idea how it can continue to follow the user's finger whilst still growing?


If you are scaling a UIView you shouldn't try to animate the position of the same UIView at the same time. This is because the UIView is animating its frame property as well as its scale (it animates from the center, so this makes sense).

I would wrap the button in another UIView, and animate the position of the wrapped view, while allowing the button view to animate the scale.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜