gpt4 book ai didi

ios - UIView 摆动

转载 作者:行者123 更新时间:2023-11-29 02:02:51 28 4
gpt4 key购买 nike

如何实现模拟钟摆运动的 UIView(在本例中为 ImageView )的动画?我希望它从左向右摆动并重复。

最佳答案

[UIView animateKeyframesWithDuration:0.3f delay:0.f options:UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse animations:^{
[self.imgview setFrame:CGRectMake(self.imgview.frame.origin.x + 50 ,self.imgview.frame.origin.y, self.imgview.frame.size.width, self.imgview.frame.size.height)];

} completion:^(BOOL finished) {

}];

关于ios - UIView 摆动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30139457/

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