我是ios开发公司的新手。我有个问题。
现在,在我的项目中,我使用了带有2 viewControllers的viewControllers(ViewController1,ViewController2)。
ViewController1是起始页。当我运行每一页时(ViewController1,ViewController2,ViewController3,.)有UITabBarController。
但是在某些页面(例如: ViewController4)中,我想隐藏并在ViewController4中添加新的UITabBarController2
如何修理?
感谢你的帮助,为我在英语方面的错误感到抱歉。^^
发布于 2014-01-03 08:11:50
试着用这个隐藏选项卡
- (void)hideTabBar:(UITabBarController *) tabbarcontroller
{
CGRect screenRect = [[UIScreen mainScreen] bounds];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
float fHeight = screenRect.size.height;
if( UIDeviceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation) ){
fHeight = screenRect.size.width;
}
for(UIView *view in tabbarcontroller.view.subviews){
if([view isKindOfClass:[UITabBar class]]){
[view setFrame:CGRectMake(view.frame.origin.x, fHeight, view.frame.size.width, view.frame.size.height)];
}else{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, fHeight)];
view.backgroundColor = [UIColor blackColor];
}
}
[UIView commitAnimations];
}和
[self hideTabBar: UITabBarController1];发布于 2014-01-03 08:19:22
app.tabBarController.tabBar.hidden=TRUE;
app.tabBarController.tabBar.hidden=TRUE;
//Set some tab
[app.tabBarController setSelectedIndex:0];https://stackoverflow.com/questions/20878960
复制相似问题