您的位置:首页 > 其它

添加Tabbae渐隐动画效果

2016-02-23 13:05 531 查看
/**

 *  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];

    

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: