点击tabbaritem的时候,增加一个动画效果:
颤抖吧o(*////▽////*)q
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
//[UIView beginAnimations:nil context:nil];
//[UIView setAnimationDuration:1];
//[UIView setAnimationBeginsFromCurrentState:NO];
//[UIView setAnimationCurve:UIViewAnimationTransitionFlipFromLeft];
//[UIView setAnimationTransition:kCATransitionMoveIn forView:tabBarController.view cache:YES];
//[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:viewController.view cache:NO];
//[viewController.view removeFromSuperview];
//[UIView commitAnimations];
CATransition *animation =[CATransition animation];
[animation setDuration:0.75f];
[animation setType:@"rippleEffect"];
[animation setSubtype:kCATransitionFromRight];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];
[tabBarController.view.layer addAnimation:animation forKey:@"switchView"];
return YES;
}
网友评论