空白代替隐藏的标签栏
我在 UITabBarController
中使用 UINavigationController
,导航控制器中的屏幕之一是 UIImageView
。当我想全屏显示该图像时,我必须隐藏导航栏和标签栏。我能够正确隐藏导航栏,但是当我隐藏选项卡栏时,它会留下 50px 的空白。有什么建议吗?
I use UINavigationController
inside UITabBarController
and one of the screens in my navigationcontroller is a UIImageView
. When I want to show that image full screen I have to hide the navigation bar and tab bar. I'm able to hide the navigation bar correctly but when I hide the tab bar, it leaves 50px of white space. Any suggestion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我认为你可以在模型视图控制器上显示它。
将 modelviewcontroller 放在 tabbarcontroller 上。
FullImageView.h
FullImageView.m
I think you can show it on model view controller.
Put modelviewcontroller over tabbarcontroller.
FullImageView.h
FullImageView.m
我通过改变约束解决了这个问题。
我的选项卡栏 viewController 中有一个视图,其底部约束是从 Safe Area.bootom 给出的 (=0)。这导致底部出现空白。从 Superview.bottom 将此约束更改为 (=0) 解决了我的问题。
I solved this problem by changing constraints.
I had a view in my tabbar viewController whose bottom constraint was given (=0) from Safe Area.bootom. This was causing white space at the bottom. Changing this constraint to (=0) from Superview.bottom solved my proble.
您可以增加图像视图框架的高度。
You can increase the height of your image view frame.
经过几个小时的研究,该线程解决了隐藏选项卡栏时的空白问题: 将 iPhone 设备旋转至横向时隐藏 TabBar
After hours of research, this thread resolved my blank space issue when hidding the tabbar: hiding TabBar when rotating iPhone device to landscape
距离最初的帖子已经过去了很长一段时间,但我想我可以加入并添加我的想法。
另一种选择是直接在情节提要中为所有在选项卡栏控制器内的导航控制器中推送的控制器设置选项
推送时隐藏底部栏
。这也适用于 iOS7 模拟器/目标,无论是 3.5 英寸还是 4 英寸。It's been quite a long time since the original post, but I thought I could jump in and add my thoughts.
Another option would be to set the option
Hide bottom bar on push
directly within the Storyboard for all those controllers which are pushed within a navigation controller inside a tabbar controller. This works within iOS7 simulator/targets as well, both at 3.5" and 4".谢谢大家
我已经找到了解决我的问题的最佳方案。
它给了我想要的回应。
谢谢你的分享
Thank you for all
I have found the best solution to my problem .
It gave me the response I wanted .
Thank you for your share