简体   繁体   English

iPhone:如何隐藏标签栏以显示全屏视图

[英]iPhone: How to hide tab bar to show fullscreen view

I have gallery view in my iphone app. 我的iPhone应用程序中有图库视图。 On tap gesture, I am hiding the Navigation bar by: 在点击手势时,我通过以下方式隐藏了导航栏:

[self.navigationController setNavigationBarHidden:activated animated:YES];

I have tab bar also, how to hide it and display the image as full screen? 我也有标签栏,如何隐藏它并以全屏显示图像?

CATransition *animation = [CATransition animation];
[animation setType:kCATransitionFade];
[[self.view.window layer] addAnimation:animation forKey:@"layerAnimation"]; 
[self.tabBarController.tabBar setHidden:YES];

// Display tab bar animated
CATransition *animation = [CATransition animation];
animation setType:kCATransitionFade];
[[self.view.window layer] addAnimation:animation forKey:@"layerAnimation"]; 
[self.tabBarController.tabBar setHidden:NO];

I have not checked this code but I think it will work 我尚未检查此代码,但我认为它将起作用

[[self navigationController] setHidesBottomBarWhenPushed:YES];

我希望这能帮到您。

self.hidesBottomBarWhenPushed = YES;
this will hide the tabbar 

If it a UITabBarController then it has a property tabBar . 如果它是UITabBarController则它具有属性tabBar

tabBarController.tabBar.hidden = YES

should work for you. 应该为您工作。 Also if your image is not a full size then change the frame of UIImageView to CGRectMake(0, 0, 320, 460); 同样,如果您的图像不是完整尺寸,则将UIImageView的帧更改为CGRectMake(0,0,320,460); if you are showing a status bar. 如果您正在显示状态栏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM