隐藏标签栏显示空白(即使框架是全屏)
尝试在选项卡控制器中进行全屏视图。这是风景。能够使用 self.tabBarController.tabBar.hidden = YES
隐藏选项卡栏,这会在选项卡栏所在的位置留下空白。
使 tabbarcontroller 的视图全屏显示:
self.tabBarController.view.frame = self.view.frame = CGRectMake(0, 0, 480, 320);
[self.tabBarController.view setCenter:CGPointMake(160.0f, 240.0f)];
self.tabBarController.tabBar.hidden = YES;
self.tabBarController.view.backgroundColor = [UIColor redColor];
然后我尝试使 viewcontrollers 也全屏显示。但它不会粘住,无法调整 view.frame
的大小。
self.view.backgroundColor = [UIColor yellowColor];
self.view.frame = CGRectMake(0, 0, 480, 320);
[self.view setCenter:CGPointMake(160.0f, 240.0f)];
有没有办法以一种很好的方式解决这个问题?
Trying to make fullscreen view in a tabbarcontroller. It's in landscape. Are able to hide the tabbar with self.tabBarController.tabBar.hidden = YES
this leaves a whitespace where the tabbar have been.
Making the tabbarcontroller's view fullscreen with:
self.tabBarController.view.frame = self.view.frame = CGRectMake(0, 0, 480, 320);
[self.tabBarController.view setCenter:CGPointMake(160.0f, 240.0f)];
self.tabBarController.tabBar.hidden = YES;
self.tabBarController.view.backgroundColor = [UIColor redColor];
Then I try to make the viewcontrollers view fullscreen also. But it will not stick, unable to resize view.frame
.
self.view.backgroundColor = [UIColor yellowColor];
self.view.frame = CGRectMake(0, 0, 480, 320);
[self.view setCenter:CGPointMake(160.0f, 240.0f)];
Is there anyway to get around this in a nice fashion?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在推送 viewController 之前,将 hidesBottomBarWhenPushed 属性设置为 YES。
Set hidesBottomBarWhenPushed property to YES before pushing your viewController.
您是否尝试使用视图控制器的 autoresizingMask 属性,而不是尝试手动调整视图框架的大小?
Did you try to play with autoresizingMask property of your view controllers instead of trying to resize manually the view frames ?