视图1:
[UIView beginAnimations:@"filpping view" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];
[self.view addSubview:detailController.view];
[UIView commitAnimations];
视图2:
[UIView beginAnimations:@"filpping view" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view.superview cache:YES];
[self.view removeFromSuperview];
翻转效果的一些简单解释:
[UIView beginAnimations:@"filpping view" context:nil]; 定义一个翻转效果
[UIView setAnimationDuration:1]; 设置动画事件
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; 设置动画开始慢,后面逐渐便快
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view.superview cache:YES];设置向右翻转,设置当前视图.
[self.view removeFromSuperview]; 执行这个动画
[UIView commitAnimations];
阅读(935) | 评论(0) | 转发(0) |