我想动态更改选项卡栏颜色。我知道我们可以在 AppDelegate 中更改它,但是如何在 View Controller 中更改它?
谢谢。
最佳答案
您可以在 UITabBarView Controller 内执行此操作:
self.tabBar.backgroundColor = UIColor(rgb: 0x12ff11)
这将为您提供绿色背景。如果您有对 tabBarController
的引用,您可以这样做:
self.tabBarController?.tabBar.backgroundColor = UIColor.redColor()
关于xcode - 动态更改标签栏背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31363015/