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

问题描述 投票:7回答:6

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

ios uinavigationcontroller uitabbarcontroller uinavigationbar uitabbar
6个回答
7
投票

谢谢你,我找到了解决问题的最佳方案。

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

它给了我想要的回应。谢谢你的分享


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    
}

0
投票

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


0
投票

经过几个小时的研究,这个线程在隐藏tabbar时解决了我的空白问题:qazxsw poi


0
投票

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

另一种选择是在故事板中直接为选项卡设置选项hiding TabBar when rotating iPhone device to landscape,这些控制器是在tabbar控制器内的导航控制器内推送的。这也适用于iOS7模拟器/目标,均为3.5“和4”。


0
投票

我通过改变约束来解决这个问题。

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

© www.soinside.com 2019 - 2024. All rights reserved.