點擊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;
}