您的位置:首页 > 移动开发 > IOS开发

IOS零碎技术整理(2)-隐藏系统Tabbar

2013-09-05 11:09 369 查看
原理就是将tabbar移出显示区

-(void)hideSystemTabBar:(UITabBar*) tabbarcontroller {

[UIView beginAnimations:nil context:NULL];//动画效果,可以不用

[UIView setAnimationDuration:0.1];

for(UIView* view in tabbarcontroller.subviews)

{

if([view isKindOfClass:[UITabBarclass]])

{

[view setFrame:CGRectMake(view.frame.origin.x,WCGLOBAL_SCREEN_SIZE.height, view.frame.size.width, view.frame.size.height)];

}

else

{

[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width,WCGLOBAL_SCREEN_SIZE.height)];

}

}

[UIView commitAnimations];

}

-(void)showSystemTabBar:(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,WCGLOBAL_SCREEN_SIZE.height - WCTabBarHeight, view.frame.size.width, view.frame.size.height)];

}

else

{

[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width,WCGLOBAL_SCREEN_SIZE.height - WCTabBarHeight)];

}

}

// [UIView commitAnimations];

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