xcode , iphone动画效果setAnimationPosition

发布于 2024-11-19 00:51:55 字数 201 浏览 2 评论 0原文

除了还有其他方法吗

[UIView setAnimationPosition:CGPoint(0,0)];

我正在实现“吸吮效果”,但效果一直到左上角。

我希望效果被“吸”到特定位置。

setAnimationPosition 似乎是这样,但它不起作用/已贬值?

is there any other method other than

[UIView setAnimationPosition:CGPoint(0,0)];

i'm implementing the 'suck effect' but the effect keeps going to the top left hand corner .

i want the effect to be 'sucked' to a specific position .

setAnimationPosition seems like the way but it isnt working / depreciated?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一曲琵琶半遮面シ 2024-11-26 00:51:55

你可以试试这个。

[UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{CGAffineTransform transform= CGAffineTransformMakeTranslation(170, 20);
        [myImage setTransform:transform];
    } completion:nil];

如果你想获得更好的效果,请将其添加到代码中:

 CGAffineTransformMakeScale(myScale, myScale);

并使用 concat 连接两个动画

CGAffineTransformConcat(scaleAnim, transform);

You can try this.

[UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{CGAffineTransform transform= CGAffineTransformMakeTranslation(170, 20);
        [myImage setTransform:transform];
    } completion:nil];

If you want to have a better effect add this to the code:

 CGAffineTransformMakeScale(myScale, myScale);

and use concat to join both the animations

CGAffineTransformConcat(scaleAnim, transform);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文