2017-03-25

2017-03-27  本文已影响0人  LeftJoin

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

}

}

上一篇下一篇

猜你喜欢

热点阅读