UITabBarControllerのボタンの色を変える
3125 ワード
はじめに
UITabBarControllerのボタンの色を変えたい。
環境
Xcode 12.4
Swift 5.3.2
実装
タブバーコントローラーに遷移する前の画面で色を指定しました。
MenuViewController
override func viewDidLoad() {
UITabBar.appearance().tintColor = .red
UITabBar.appearance().unselectedItemTintColor = .darkGray
}
func next() {
let storyboard = UIStoryboard(name: "Next", bundle: nil)
let next = storyboard.instantiateViewController(identifier: "Next")
guard let tabBarCon = next as? UITabBarController else { return }
self.navigationController?.pushViewController(tabBarCon, animated: true)
}
結果
感想
今後も何度か調べそうな内容だなと思いました。
参考記事に感謝です。
参考記事
Author And Source
この問題について(UITabBarControllerのボタンの色を変える), 我々は、より多くの情報をここで見つけました https://qiita.com/_yoshitaka/items/df3d96cafb4184059992著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .