白色空间代替隐藏的标签栏

时间:2012-02-03 11:54:48

标签: ios uinavigationcontroller uitabbarcontroller uinavigationbar uitabbar

我在UINavigationController中使用UITabBarController,我的navigationcontroller中的一个屏幕是UIImageView。当我想要全屏显示图像时,我必须隐藏导航栏和标签栏。我可以正确隐藏导航栏但是当我隐藏标签栏时,它会留下50px的空白区域。有什么建议吗?

6 个答案:

答案 0 :(得分:7)

谢谢大家 我找到了解决问题的最佳方案。

MyImageViewController.hidesBottomBarWhenPushed = YES ;
[self.navigationController pushViewController:MyImageViewController animated:YES];

它给了我想要的回复。 感谢您的分享

答案 1 :(得分:2)

我认为你可以在模型视图控制器上显示它。 将modelviewcontroller放在tabbarcontroller上。

FullImageView*objFullImageView = [[FullImageView alloc] initWithNibName:@"FullImageView" bundle:nil];
objFullImageView.image = OriginalImage;
UINavigationController *tempNav = [[[UINavigationController alloc] initWithRootViewController:objFullImageView] autorelease];
[objFullImageView release];
self.tabBarCtrl.modalPresentationStyle = UIModalPresentationPageSheet;
[self.tabBarCtrl presentModalViewController:tempNav animated:YES];

FullImageView.h

{  
    UIImage *image;
}
@property(nonatomic, retain) UIImage *image;

FullImageView.m

@synthesize image;

viewDidLoad /ViewWillApper
{
    //Set image in your UIImageView    
}

答案 2 :(得分:0)

您可以增加图像视图框的高度。

答案 3 :(得分:0)

经过数小时的研究,此线程在隐藏标签栏时解决了我的空白问题:hiding TabBar when rotating iPhone device to landscape

答案 4 :(得分:0)

自原帖以来已经很长时间了,但我想我可以跳进来添加我的想法。

另一种选择是直接在Storyboard中为所有那些在tabbar控制器内的导航控制器内推送的控制器设置选项Hide bottom bar on push。这也适用于iOS7模拟器/目标,均为3.5“和4”。

答案 5 :(得分:0)

我通过更改约束条件解决了这个问题。

我在我的标签栏viewController中有一个视图,其底部约束是从Safe Area.bootom提供的(= 0)。这导致底部出现空白。从Superview.bottom将此约束更改为(= 0)解决了我的问题。