如何以编程方式隐藏选项卡栏,然后展开视图以适合 [英] How to hide tab bar programmatically and then expand view to fit

查看:56
本文介绍了如何以编程方式隐藏选项卡栏,然后展开视图以适合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从以下问题获得了代码:如何以编程方式隐藏UITabBarController?很棒,但是视图不会扩展到适合选项卡栏剩余的空间.

I got the code from this question: How to hide UITabBarController programmatically? which is brilliant, however the view doesn't expand to fit the space left by the tab bar now.

我已经为视图设置了适当的UIViewAutoresizingMasks,但是我假设仅仅是因为它的隐藏并不意味着它还不会占用空间?

I have set the appropriate UIViewAutoresizingMasks to the view, but I'm assuming that just because its hidden doesn't mean its not still taking up the space?

无论如何,如果我执行[self.navigationController setNavigationBarHidden:YES animated:YES];,则导航栏将在屏幕上移和移下,并以此扩展视图.

Anyway, if I do [self.navigationController setNavigationBarHidden:YES animated:YES]; then the navigation bar moves up and off the screen expanding the view with it.

如何为标签栏复制此行为?

How can I replicate this behavior for the Tab Bar?

推荐答案

结果不太可能.最好的方法是呈现一个模式视图(导航)控制器,而不是按下视图控制器.

Turns out its not quite possible. Best way is to present a modal view (navigation) controller instead of pushing a view controller.

这篇关于如何以编程方式隐藏选项卡栏,然后展开视图以适合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆