1. 从中间展开一个View
CGRect screenFrame = [[UIScreen mainScreen] bounds];
[detailView setFrame:CGRectMake(screenFrame.size.width/2, 230/2, 0, 0)];
//show aniamtion
[UIView animateWithDuration:0.25 animations:^{
self.detailView.alpha = 1.f;
[detailView setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
} completion:^(BOOL finished) {
[detailView setRenderStatic:YES];
[detailView reloadData];
[MTConfig setIsCompleteTaskFlag:NO];
从中间一点消失一个View
[UIView animateWithDuration:0.25
animations:^{
detailView.clipsToBounds = YES;
[detailView setFrame:CGRectMake(screenFrame.size.width/2, 230/2, 0, 0)];
}
completion:^(BOOL finished){
[mainViewController refreshView];
if (detailView) {
[detailView removeFromSuperview];
detailView = nil;
}
}
2. //向上翻滚动画
CATransition *animation = [CATransition animation];
animation.duration = 0.5;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.fillMode = kCAFillModeForwards;
animation.removedOnCompletion = NO;
animation.type = kCATransitionPush;
animation.subtype = kCATransitionFromTop;
[btn.layer addAnimation:animation forKey:@"animation"];