gpt4 book ai didi

ios - 如何做放大和变换动画?

转载 作者:行者123 更新时间:2023-11-29 11:46:05 24 4
gpt4 key购买 nike

很清楚如何进行放大/缩放 animation以及如何将图像动画化为 another .但是我需要一个图像来放大并中途转换为另一个图像。怎么做到的?

最佳答案

此代码将为您工作。

[UIView animateWithDuration:2.0 animations:^{
imgView.transform = CGAffineTransformMakeScale(1.5, 1.5);
}
completion:^(BOOL finished){
[UIView transitionWithView:self.view
duration:2.0f
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
[imgView setImage:[UIImage imageNamed:@"default_avatar"]];
imgView.transform = CGAffineTransformMakeScale(2.0, 2.0);
} completion:nil];
}];

关于ios - 如何做放大和变换动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43802672/

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