availableButton.frame = CGRectMake(0, screenHeight - tabBarHeight!, CGFloat(screenWidth/5.0) * 2.0, tabBarHeight!)
availableButton.backgroundColor = FlatGreen()
availableButton.setTitle("Turn On", forState: UIControlState.Normal)
availableButton.setTitleColor(UIColor.whiteColor(), forState: UIControlState.Normal)
availableButton.titleLabel?.font = UIFont(name: "Roboto-Bold", size: 20.0)
self.view.addSubview(availableButton)
这是我添加到我的TabBarViewController
中的按钮。如何隐藏我添加到UITabBar的自定义按钮?
当我隐藏我的标签栏:
tabBarController?.tabBar.hidden = true
我想这个按钮被隐藏。
我的按钮是2个标签栏项目的宽度。
您要添加该按钮在self.view,所以隐藏tabbar不会隐藏主视图上的按钮 –
@Racheel,我可以在哪里添加它然后? – TIMEX
给我们展示了一些设计,你想要达到什么样的效果,同时你可以制作这个按钮的实例并隐藏它,当你隐藏你的标签栏 –