2012-02-28 81 views
0

我在我的iPhone应用程序中有画廊视图。在点触手势,我躲在被导航条:iPhone:如何隐藏标签栏以显示全屏视图

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

我有标签栏也,如何隐藏和显示图像的全屏?

+0

是不是'UITabBarController'?或简单的'UITabBar'? – 2012-02-28 04:24:07

+0

可能重复的[如何隐藏标签栏控制器?](http://stackoverflow.com/questions/7466829/how-to-hide-tab-bar-controller) – 2012-02-28 04:27:47

+0

@InderKumarRathore,它是'UITabBarController' – Shameem 2012-02-29 15:23:47

回答

0
self.hidesBottomBarWhenPushed = YES; 
this will hide the tabbar 
+0

如果你想要在按下时隐藏底部条,将有助于 – 2012-02-28 05:05:23

0

如果一个UITabBarController那么它有一个属性tabBar

tabBarController.tabBar.hidden = YES 

应该为你工作。 此外,如果您的图像不是一个完整的大小,然后将UIImageView的帧更改为CGRectMake(0,0,320,460);如果你正在显示一个状态栏。

+1

在图像顶部出现白色条(位于标签栏位置)(即使在隐藏标签栏并调整图像视图框的大小后)。 – Shameem 2012-02-29 15:30:04

+0

尝试使该区域透明。我不知道它是什么,但你可以尝试... – 2012-02-29 16:27:08

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

我没有检查这个代码,但我认为它会工作

+0

你可以更新你的答案,而不是回答一个新的问题。 – 2012-02-28 04:56:32

+0

@krishna:我在底部(在标签栏的地方)看到一条灰白色的酒吧。 – Shameem 2012-02-29 15:26:58

2
[[self navigationController] setHidesBottomBarWhenPushed:YES]; 

我希望这会帮助你。