[英]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.