关于如何隐藏UITabbar的问题,曾经困扰过很多人。

1,设为Hidden, 这种方法虽然将TabBar隐藏掉,但是下面是一片空白,没有起到隐藏的实际功效

2,设置tabbar.frame = CGRectMake(0,480+);既将tabbar的frame 降低到屏幕一下。 这种方法也不行。

其实iphone SDK里面有一个参数,可以直接隐藏掉UITabBar:

1
2
3
4
5
6
7
<div class="cnblogs_Highlighter"><pre class="brush:objc">UIViewCtrlTest* testCtrl = [[UIViewCtrlTest alloc] initW];
            threeModalView.hidesBottomBarWhenPushed = YES;
            [self.navigationController pushViewController:testCtrl animated:YES];
                        threeModalView.hidesBottomBarWhenPushed = NO;//马上设置回NO
            [testCtrl release];
</pre>
</div>

不过使用该参数,虽然可以成功隐藏TabBar,但是popup回来的时候,有可能Tababr没有再出现, 既用户一旦隐藏,就无法重现了。

这个问题,有人建议在viewWillAppear 和 viewWillDisAppear里面设置

1
hidesBottomBarWhenPushed为TRUE 和 FALSE。
1
<br>
1
我自己的做法是:
1
2
3
4
5
6
7
8
<div class="cnblogs_Highlighter"><pre class="brush:objc">                       UIViewCtrlTest* testCtrl = [[UIViewCtrlTest alloc] initW];
            testCtrl.hidesBottomBarWhenPushed = YES;
            [self.navigationController pushViewController:testCtrl animated:YES];
                        testCtrl.hidesBottomBarWhenPushed = NO;//马上设置回NO
            [testCtrl release];
</pre>
</div>
<br>

转载自:  http://www.cnblogs.com/moshengren/archive/2010/10/18/1855202.html

 

最新文章

  1. Python 中的urlencode和urldecode
  2. Jstorm可靠性分析
  3. JAVA开发环境和IntelliJ工具安装
  4. xcode报错,svn : is not a workingCopy
  5. SQL Server T-SQL高级查询
  6. andriod Spinner
  7. [转载] LinkedIn架构这十年
  8. C++@类的静态成员变量和静态成员函数
  9. Ubuntu server搭建vsftpd小记
  10. Matlab聚类分析[转]
  11. COJ 0332 The Flash
  12. POJ 2442 Squence (STL heap)
  13. PHPWAMP开启php_stomp.dll的具体方式,php5.6开启stomp的图解过程
  14. spring中aop的注解实现方式简单实例
  15. React Native 轻松集成统计功能(iOS 篇)
  16. 用shell脚本挂载linux主机拷贝相应文件copy.sh
  17. sql server 死锁排查
  18. 微信小程序实战练习(仿五洲到家微信版)
  19. 解决InetAddress.isReachable(timeout)在windows xp始终返回false的bug
  20. ASP.NET Core 入门教程 1、使用ASP.NET Core 构建第一个Web应用

热门文章

  1. Find out when memory leaks are a concern and how to prevent them
  2. Struts2页面遍历
  3. 在springboot中使用Mybatis Generator的两种方式
  4. Codeforces Round #379 (Div. 2) E. Anton and Tree —— 缩点 + 树上最长路
  5. codeforces B. Trees in a Row 解题报告
  6. python中类的定义方法
  7. ubuntu166.04之Caffe安装
  8. BZOJ4936:match (不错的分治)
  9. tyvj2044 旅游景点
  10. 图片轮播和C3动画