显示 隐藏 tabbar的方法(环信UI中使用的)
2016-01-11 18:34
453 查看
隐藏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;
}
/**
* 显示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;
}
*/
- (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;
}
/**
* 显示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;
}
相关文章推荐
- 自动调节自号大小UIlabel 自适应字号
- iOS UI-静态单元格与动态单元格
- uiautomator基本操作命令
- UINavigationBar-设置
- Windows 10家庭版也能共享打印机(上)启用Guest账户
- 基于SpriteKit的游戏,如何添加界面
- 动态修改UINavigationBar的背景色
- Unreal Engine4学习笔记--1如何保存加载游戏数据
- 自定义UITextView控件
- 从刷机到被刷机:小米MIUI未老先衰
- UITableView 性能优化
- Looper.myQueue().addIdleHandler,在activty界面显示后做一些事情,就在这个idlehandler中做
- druid 文档 和 源码地址
- UILabel 详解
- AirPrint: 无交互的后台打印实现(Print without UI,iOS8+)
- Fuel安装方法
- iOS UIImage 图片局部拉伸的一些学习要点
- 哈理工OJ HLG OJ 1005Counting Subsequences(map应用)(STL应用)
- 在iOS 9中不在使用UIAlertView使用UIAlertController
- qt-gui的GUI hint参数