/**
* tabbar渐隐效果
*/
//给ViewController设置反回代理
@protocol TabBarAnimatetionDelegate
-(void)BackHideTabBarDelegateMoth:(BOOL)_Hide;
@end
//添加动画
+(void) hideTabBar:(BOOL) hidden WithTabbarController:(UITabBarController *)tabbar{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
for(UIView *view in tabbar.view.subviews)
{
if([view isKindOfClass:[UITabBar class]])
{
if (hidden) {
[view setFrame:CGRectMake(view.frame.origin.x, kMainHeight, view.frame.size.width, view.frame.size.height)];
} else {
[view setFrame:CGRectMake(view.frame.origin.x, kMainHeight-49, view.frame.size.width, view.frame.size.height)];
}
}
else
{
if (hidden) {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, kMainHeight)];
} else {
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, kMainHeight-49)];
}
}
}
[UIView commitAnimations];
}