[英]Swift: Change the image tint color of tab bar?
我以编程方式创建了 tabBarController 并且我想更改选项卡包含的图像(而不是条)的色调颜色。 谁能告诉我如何在 Swift 中做到这一点?
在您的“应用程序:didFinishLaunchingWithOptions”中
(window?.rootViewController as! UITabBarController).tabBar.tintColor = UIColor.red
或使用外观委托。
UITabBar.appearance().tintColor = UIColor.red
转到 AppDelegate.swift 文件。 在“应用程序:didFinishLaunchingWithOptions”中写:
UITabBar.appearance().unselectedItemTintColor = UIColor.red
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.