隐藏iOS中标签栏中的标签(Swift)
答
使用下面的代码隐藏在IOS /显示标签栏
var tab = UITabBarController()
override func viewDidLoad()
{
super.viewDidLoad()
tab.tabBar.hidden = true //set false to show
}
+0
它不工作。 –
+0
这将隐藏整个标签栏。问的问题是如何隐藏标签栏中的单个标签按钮。 – UserID0908
答
假设你拥有的UITabBarController的子类:
class YourSubClass: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
viewControllers?.remove(at: 0) // tab index starts with 0, this will remove the first tab
}
}
此链接可以帮助你http://stackoverflow.com/a/36306881/3918500 –
的http://计算器。 com/questions/26850411/how-add-tabs-program-in-uitabbarcontroller-with-swift请检查这个 –
@James Lee你是否找到答案,如果是的话,请在这里发布。 – Prabu