gpt4 book ai didi

ios - 如何从屏幕外为 ImageView 设置动画

转载 作者:行者123 更新时间:2023-11-29 00:26:45 25 4
gpt4 key购买 nike

我有一个 ImageView ,我把它放到一个圆的 View Controller 上。

我想从屏幕外开始那个圆圈并将它移动到我放置它的位置。

制作动画的最佳方式是什么?

最佳答案

试试这个;

-(void)viewWillAppear {
[UIView animateWithDuration:5
delay:5
options:UIViewAnimationOptionCurveEaseOut
animations:^{
CGRect frame = view.frame;
frame.origin.y = self.view.frame.size.height-200;
frame.origin.x = 0;
view.frame = frame;
}completion:^(BOOL finished) {}];
}

许多动画选项的[UIViewAnimationOptions]

    UIViewAnimationOptionCurveEaseInOut,
UIViewAnimationOptionCurveLinear,
UIViewAnimationOptionTransitionFlipFromLeft,
UIViewAnimationOptionTransitionCurlUp,
UIViewAnimationOptionTransitionCrossDissolve,
UIViewAnimationOptionTransitionFlipFromTop..

关于ios - 如何从屏幕外为 ImageView 设置动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42794398/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com