- -(void) hideTabBar:(UITabBarController*) tabbarcontroller {
- [UIView beginAnimations:nil context:NULL];
- [UIView setAnimationDuration:0.5];
- for(UIView*view in tabbarcontroller.view.subviews)
- {
- if([view isKindOfClass:[UITabBarclass]])
- {
- [view setFrame:CGRectMake(view.frame.origin.x,480, view.frame.size.width, view.frame.size.height)];
- }
- else
- {
- [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width,480)];
- }
- }
- [UIView commitAnimations];
- }
- -(void) showTabBar:(UITabBarController*) tabbarcontroller {
- [UIView beginAnimations:nil context:NULL];
- [UIView setAnimationDuration:0.5];
- for(UIView*view in tabbarcontroller.view.subviews)
- {
- NSLog(@"%@", view);
- if([view isKindOfClass:[UITabBarclass]])
- {
- [view setFrame:CGRectMake(view.frame.origin.x,431, view.frame.size.width, view.frame.size.height)];
- }
- else
- {
- [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width,431)];
- }
- }
- [UIView commitAnimations];
- }
- //该片段来自于http://www.codesnippet.cn/detail/101220137903.html
来源: http://www.codesnippet.cn/detail/101220137903.html