关于如何隐藏UITabbar的问题
2024-09-30 02:25:11
关于如何隐藏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
最新文章
- Python 中的urlencode和urldecode
- Jstorm可靠性分析
- JAVA开发环境和IntelliJ工具安装
- xcode报错,svn : is not a workingCopy
- SQL Server T-SQL高级查询
- andriod Spinner
- [转载] LinkedIn架构这十年
- C++@类的静态成员变量和静态成员函数
- Ubuntu server搭建vsftpd小记
- Matlab聚类分析[转]
- COJ 0332 The Flash
- POJ 2442 Squence (STL heap)
- PHPWAMP开启php_stomp.dll的具体方式,php5.6开启stomp的图解过程
- spring中aop的注解实现方式简单实例
- React Native 轻松集成统计功能(iOS 篇)
- 用shell脚本挂载linux主机拷贝相应文件copy.sh
- sql server 死锁排查
- 微信小程序实战练习(仿五洲到家微信版)
- 解决InetAddress.isReachable(timeout)在windows xp始终返回false的bug
- ASP.NET Core 入门教程 1、使用ASP.NET Core 构建第一个Web应用
热门文章
- Find out when memory leaks are a concern and how to prevent them
- Struts2页面遍历
- 在springboot中使用Mybatis Generator的两种方式
- Codeforces Round #379 (Div. 2) E. Anton and Tree —— 缩点 + 树上最长路
- codeforces B. Trees in a Row 解题报告
- python中类的定义方法
- ubuntu166.04之Caffe安装
- BZOJ4936:match (不错的分治)
- tyvj2044 旅游景点
- 图片轮播和C3动画