gpt4 book ai didi

ios - 如何将 UIButton 置于 TabBar 的前面?

转载 作者:行者123 更新时间:2023-11-30 13:45:22 25 4
gpt4 key购买 nike

我有一个 TabBar,我想在上面添加 UIButton,但它位于 tabBar 的后面:

图片( http://i.stack.imgur.com/RxGXb.png )

如何将其置于前面并覆盖 TabBar?

我已经尝试过这个:

override func viewDidLayoutSubviews() {
tabBarController?.tabBar.bringSubviewToFront(addButton)
}

但这对我没有帮助

最佳答案

你不能轻易做到。您可以子类化 UITabBar 类,但这会使 you handle it yourself (没有 UITabBarController):

Do not modify a tab bar that is managed by a tab bar controller (an instance of the UITabBarController class). If you do so, the system raises an exception. Modify a managed tab bar, or its items, only through the tab bar controller API.

关于ios - 如何将 UIButton 置于 TabBar 的前面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35019647/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com