[英]How to bring UIButton to front on TabBar?
I have a TabBar and I want to add UIButton on it, but it stays behind of tabBar: 我有一个TabBar,我想在上面添加UIButton,但它不位于tabBar后面:
Image( http://i.stack.imgur.com/RxGXb.png ) 图片( http://i.stack.imgur.com/RxGXb.png )
How can I bring it to front and make over the TabBar? 我怎样才能将其放在TabBar的最前面?
I've tried this one: 我已经尝试过这个了:
override func viewDidLayoutSubviews() {
tabBarController?.tabBar.bringSubviewToFront(addButton)
}
but it doesn't help me 但这对我没有帮助
You can't easily. 你不容易。 You could subclass the UITabBar class, but that would make you handle it yourself (without a UITabBarController):
您可以继承UITabBar类的子类,但这将使您自己处理它 (没有UITabBarController):
Do not modify a tab bar that is managed by a tab bar controller (an instance of the UITabBarController class).
不要修改由标签栏控制器(UITabBarController类的实例)管理的标签栏。 If you do so, the system raises an exception.
如果这样做,系统将引发异常。 Modify a managed tab bar, or its items, only through the tab bar controller API.
仅通过标签栏控制器API修改托管的标签栏或其项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.