UIView三种动画笔记

1
2
3
4
5
6
7
8
9
[UIView animateWithDuration:0.6f
        delay:0
        options:UIViewAnimationOptionCurveEaseOut
      animations:^{
         self.view.alpha = 0;
      }
      completion:^(BOOL finished) {
         [self.view removeFromSuperview];
}];

1
2
3
4
5
[UIView beginAnimations:@"animation" context:nil];
[UIView setAnimationDuration:0.8f];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:delegate.tabBarController.view cache:YES];
[UIView commitAnimations];
1
2
3
4
5
6
7
8
CATransition *animation = [CATransition animation];
animation.duration = 0.8f;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.fillMode = kCAFillModeForwards;
animation.type = kCATransitionMoveIn;
animation.subtype = kCATransitionFromBottom;
[[self.view layer] addAnimation:animation forKey:@"animation"];
animation=nil;

Comments