美文网首页
2017-03-25

2017-03-25

作者: LeftJoin | 来源:发表于2017-03-27 14:34 被阅读0次

    tabbar隐藏带来的坑,

    - (void)hidesTabBar:(BOOL)yesOrNO animated:(BOOL)animated

    {

    self.tabBarHidden= yesOrNO;

    if(yesOrNO ==YES)

    {

    if(self.tabBarView.frame.origin.y==self.view.frame.size.height)

    {

    return;

    }

    }

    else

    {

    if(_tabBarView.frame.origin.y==self.view.frame.size.height-kTabBarHeight)

    {

    return;

    }

    }

    if(animated ==YES)

    {

    [UIViewbeginAnimations:nilcontext:NULL];

    [UIViewsetAnimationDuration:0.3f];

    if(yesOrNO ==YES)

    {

    _tabBarView.frame=CGRectMake(_tabBarView.frame.origin.x,_tabBarView.frame.origin.y+kTabBarHeight,_tabBarView.frame.size.width,_tabBarView.frame.size.height);

    }

    else

    {

    _tabBarView.frame=CGRectMake(_tabBarView.frame.origin.x,_tabBarView.frame.origin.y-kTabBarHeight,_tabBarView.frame.size.width,_tabBarView.frame.size.height);

    }

    [UIViewcommitAnimations];

    }

    else

    {

    [UIViewbeginAnimations:nilcontext:NULL];

    [UIViewsetAnimationDuration:0.3f];

    if(yesOrNO ==YES)

    {

    _tabBarView.frame=CGRectMake(_tabBarView.frame.origin.x,_tabBarView.frame.origin.y+kTabBarHeight,_tabBarView.frame.size.width,_tabBarView.frame.size.height);

    }

    else

    {

    _tabBarView.frame=CGRectMake(_tabBarView.frame.origin.x,_tabBarView.frame.origin.y-kTabBarHeight,_tabBarView.frame.size.width,_tabBarView.frame.size.height);

    }

    [UIViewcommitAnimations];

    }

    }

    相关文章

      网友评论

          本文标题:2017-03-25

          本文链接:https://www.haomeiwen.com/subject/xincottx.html