如何完成模仿钟摆运动的UIView动画(在本例中为图像视图)?我希望它从左向右摆动并重复。
答案 0 :(得分:1)
[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) {
}];