Iphone隐藏和显示TabBar的方法
来源:互联网 发布:宇航数控仿真软件 编辑:程序博客网 时间:2024/04/26 03:14
1.隐藏TabBar:
- - (void)hideTabBar {
- if (self.tabBarController.tabBar.hidden == YES) {
- return;
- }
- UIView *contentView;
- if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
- contentView = [self.tabBarController.view.subviews objectAtIndex:1];
- else
- contentView = [self.tabBarController.view.subviews objectAtIndex:0];
- contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y, contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);
- self.tabBarController.tabBar.hidden = YES;
- }
2.显示TabBar:
- - (void)showTabBar
- {
- if (self.tabBarController.tabBar.hidden == NO)
- {
- return;
- }
- UIView *contentView;
- if ([[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]])
- contentView = [self.tabBarController.view.subviews objectAtIndex:1];
- else
- contentView = [self.tabBarController.view.subviews objectAtIndex:0];
- contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y, contentView.bounds.size.width, contentView.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
- self.tabBarController.tabBar.hidden = NO;
- }
3.如果定义了上面两个方法,在viewDidAppear:方法里面就可以调用了
- -(void)viewDidAppear:(BOOL)animated{
- //[self hideTabBar];
- [self showTabBar];
- }
- Iphone隐藏和显示TabBar的方法
- Iphone隐藏和显示TabBar的方法
- Iphone隐藏和显示TabBar的方法
- ios隐藏和显示TabBar的方法
- tabbar的隐藏和显示
- 隐藏和显示TabBar的方法的简单总结
- 隐藏tabbar和显示tabbar
- TabBar隐藏显示的两种方法
- 隐藏TabBar的方法
- 隐藏tabBar的方法
- IOS 显示和隐藏tabbar
- 隐藏Tabbar的一些方法
- 隐藏TabBar底部的方法
- 隐藏TabBar的一些方法
- iOS 隐藏TabBar 的方法
- 滑动隐藏和显示tabBar和NavigationBar
- tabbar的隐藏和出现
- iphone中键盘的显示和隐藏
- 深度解析Java内存的原型
- Initrd/initramfs (am335x)
- QTP对象能识别,但回放的时候却不响应
- 谈谈Activiti中流程对象之间的关系
- linux并发控制之中断屏蔽
- Iphone隐藏和显示TabBar的方法
- linux____内核延迟函数分析___操作
- c#中设置按钮Button为透明
- linux并发控制之原子操作
- Windows xp环境下通过vmware安装ubuntu的网络设置
- 什么是OpenGL中的深度、深度缓存、深度测试?
- 张小娴
- 运用hadoop计算TF-IDF续-支持中文读取-支持文件输出控制
- linux并发控制之总章