[swift5] How to change the color of TabBar or the color of item of TabBar with code

How to change the color of TabBar

TabBarViewController.swift



//Change tabbar color
tabBar.barTintColor = UIColor.white

//tabbar background transparency
UITabBar.appearance().backgroundImage = UIImage()

Background transparency means that TabBar has a frosted glass-like color by default, so remove it.

How to change the color of TabBar item

TabBarViewController.swift



 //tabbar selection color setting
 tabBar.tintColor = UIColor.black
        
 //Tabbar non-selected color settings
 tabBar.unselectedItemTintColor =  UIColor.gray

Recommended Posts

[swift5] How to change the color of TabBar or the color of item of TabBar with code
Ransack sort_link How to change the color!
[Swift] Change the color of SCN Node
[Swift] How to dynamically change the height of the toolbar on the keyboard
[chown] How to change the owner of a file or directory
[Swift] How to link the app with Firebase
How to get the ID of a user authenticated with Firebase in Swift
How to implement UICollectionView in Swift with code only
How to change the action with multiple submit buttons
[Rails] How to change the column name of the table
[Swift] How to get the document ID of Firebase
Port C code with a lot of typecasts to Swift
How to change the setting value of Springboot Hikari CP
How to change the file name with Xcode (Refactor Rename)
[Swift] Change the textColor of UIDatePicker
[Swift5] How to get an array and the complement of arrays
[Rails] How to introduce kaminari with Slim and change the design
[Swift UI] How to get the startup status of the application [iOS]
[Rails] How to change the page title of the browser for each page
[swift5] How to specify color in hexadecimal
How to call Swift 5.3 code from Objective-C
How to determine the number of parallels
Bootstrap4 Change the color of the hamburger menu
[Swift] How to implement the countdown function
How to change the timezone on Ubuntu
How to sort the List of SelectItem
How to decorate the radio button of rails6 form_with (helper) with CSS
[Swift] How to connect TabBar with Storyboard Reference and also use NavigationController
How to access Socket directly with the TCP function of Spring Integration
How to convert an array of Strings to an array of objects with the Stream API
How to change the maximum and maximum number of POST data in Spark
How to change the value of a variable at a breakpoint in intelliJ
[Swift] How to get the number of elements in an array (super basic)
[swift] How to control the behavior when the back button of NavigationBar is pressed
How to find the cause of the Ruby error
graphql-ruby: How to get the name of query or mutation in controller Note
Customize how to divide the contents of Recyclerview
How to color code console output in Eclipse
[Swift] How to implement the LINE login function
[swift5] How to implement the Twitter share function
How to add sound in the app (swift)
How to get today's day of the week
Change the timezone of the https-portal container to JST
Output of how to use the slice method
[Ruby] Code to display the day of the week
[Swift] How to implement the fade-in / out function
How to write test code with Basic authentication
How Microservices Change the Way of Developing Applications
How to display the result of form input
[AndroidStudio] Change the color of the ActionBarDrawerToggle hamburger menu
[Java] How to get the authority of the folder
If you use SQLite with VSCode, use the extension (how to see the binary file of sqlite3)
A memo about the types of Java O/R mappers and how to select them
How to use git with the power of jgit in an environment without git commands
[Docker] How to see the contents of Volumes. Start a container with root privileges.
How to set the retry limit of sidekiq and notify dead queues with slack
[Rough explanation] How to separate the operation of the production environment and the development environment with Rails
Summary of how to use the proxy set in IE when connecting with Java
[Java] How to get the URL of the transition source
How to delete / update the list field of OneToMany
[Ruby] How to find the sum of each digit