---
title: "iOS 隐藏标签栏"
author: "jguangyou"
date: "2012-10-19T14:02:05Z"
tags: []
categories: ["移动开发"]
slug: "ios"
draft: false
lastmod: "2012-10-19T14:04:44Z"
id: 1701565
url: "https://deep-fish.iteye.com/blog/1701565"
---

当前ios应用是具有标签栏的，如果点击当前应用的一个东西（例如：按钮，图片），需要导航的一个全屏幕的视图，应该如何搞呢？？

其实很简单，只要设置要跳转的ViewController 的hidesBottomBarWhenPushed=YES，就可以了。例如：

 

AViewController是显示标签栏的，BViewcontroller 是将要跳转到的视图，B不需要显示标签栏，要求全屏显示。

 

在A的事件处理的方法中： 

```
BViewController* B = [[BViewController alloc] init];
B.playerUrl = [NSURL URLWithString:@“playUrl”];
video.hidesBottomBarWhenPushed = YES;    //用来隐藏标签栏
[self.navigationController pushViewController:B animated:YES];
```

 

第三句话就是需要用来隐藏标签栏的。