如何实现模拟钟摆运动的 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/