圆图上下浮动动画:
圆球上下浮动.gif
方法1:
- (void)createAnimaition{
self.animationView = [[UIView alloc] initWithFrame:CGRectMake(SIZE.width/2.0 - 30, 200, 60, 60)];
self.animationView.layer.cornerRadius =30;
self.animationView.layer.borderWidth = 2;
self.animationView.layer.borderColor = [UIColor redColor].CGColor;
self.animationView.backgroundColor = [UIColor yellowColor];
[self.view addSubview:self.animationView];
[self up];
}
- (void)up{
[UIView animateWithDuration:2 animations:^{
self.animationView.frame = CGRectMake(SIZE.width/2.0 - 30, self.animationView.frame.origin.y + 10, 60, 60);
}];
[UIView animateWithDuration:2 delay:2 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.animationView.frame