在IOS swift app中隐藏标签栏 [英] Hide tab bar in IOS swift app

查看:198
本文介绍了在IOS swift app中隐藏标签栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试图弄清楚如何隐藏iOS swift应用中的标签栏。我不关心任何花哨的动画或任何东西。我可以把它放在ViewDidLoad()函数中。

I'm trying to figure out how to hide the tab bar in my iOS swift app. I don't care about any fancy animations or anything. Just something I can put in the ViewDidLoad() function.

推荐答案

你可以在你的中使用它ViewDidLoad()方法。

self.tabBarController?.tabBar.hidden = true

对于swift 3.0:

For swift 3.0:

self.tabBarController?.tabBar.isHidden = true

或者你可以改变标签的z位置这样吧:

Or you can change z position of tab bar this way:

self.tabBarController?.tabBar.layer.zPosition = -1

如果你想再次展示它,那么:

and if you want to show it again then:

self.tabBarController?.tabBar.layer.zPosition = 0

这篇关于在IOS swift app中隐藏标签栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆