2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【iOS15】TabbarItemの色指定が反映されない不具合に対応

Posted at

iOS15で「TabBarItemの色がうまく適用されない不具合」に対応したので参考までに。色指定の方法が変更されたみたいです。

iOS15以前

self.tabBarController?.tabBar.tintColor = .white
self.tabBarController?.tabBar.unselectedItemTintColor = .lightText

iOS15以降

let appearance = UITabBarAppearance()
appearance.stackedLayoutAppearance.normal.iconColor = .white
appearance.stackedLayoutAppearance.normal.titleTextAttributes = [.foregroundColor : UIColor.lightText]

self.tabBarController?.tabBar.standardAppearance = appearance

参考記事
iOS 15 UITabBarController's tabBar background color turns black

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?