如何隐藏iPhone标签栏? [英] How to hide an iPhone Tab Bar?

查看:69
本文介绍了如何隐藏iPhone标签栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小型的多视图应用程序.它由一个UITabBarController组成,每个选项卡中均带有一个导航控制器.我想要的是在用户摇动设备时显示UIImageView.实施UIImageView的加载后,我遇到了一个问题-由于制表符和导航栏,图像仅是屏幕的2/3.我设法隐藏了导航栏,但我仍然停留在选项卡栏上.我尝试了许多解决方案,例如[tabBar setHidden: YES];,但是尽管导入了定义tabBar的AppDelegate,但仍然收到未声明tabBar"的错误.

I have a small multiview app. It consists of a UITabBarController with a nav controller in each tab. What I want is to show a UIImageView when a user shakes the device. After I've implemented the loading of the UIImageView, I faced a problem-the image was only 2/3 of the screen because of the tab and nav bars. I managed to hide the nav bar but I'm still stuck with the tab bar. I tried many solutions such as [tabBar setHidden: YES]; but I get errors "tabBar undeclared", although I've imported the AppDelegate, where the tabBar was defined.

提前谢谢!

推荐答案

尝试设置

myViewController.hidesBottomBarWhenPushed = YES;

创建UIImageView时.当您将其推入视图堆栈时,UITabBar将自动隐藏,并且在您弹出或关闭控制器时会自动恢复.不需要应用程序委托.

when you create your UIImageView. When you push it on to the view stack the UITabBar will hide automatically, and it will be restored automatically when you pop or dismiss the controller. No need for the application delegate.

这篇关于如何隐藏iPhone标签栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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