您的位置:首页 > 其它

如何在push一个视图控制器时隐藏掉自定义的TabBar

2014-09-04 21:00 375 查看
这个问题困扰了我很久很久了,今天找到了一个解决方法,废话不多说,直接上代码!

UIImageView *tabBarView = [[UIImageView alloc] init];

NSString *imageName = @"tabBar-Final.png";

tabBarView.image = [UIImage imageNamed:imageName];

tabBarView.frame = self.tabBar.bounds;

tabBarView.userInteractionEnabled = YES;

[self.tabBar addSubview:tabBarView];

通过将自定义的tabBar直接加入系统系统自带的tabBar中,那么,在下一个要被push的界面的viewWillAppear里面设置

self.hidesBottomBarWhenPushed =YES;

即可达到效果,是不是很简单呢
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐