In my app I change the color of the tab bar in the constructor of my main view to be a dark gray/black with the unselected tabs being white.
init() {
UITabBar.appearance().isTranslucent = false
UITabBar.appearance().backgroundColor = UIColor(red: 65 / 255, green: 65 / 255, blue: 65 / 255, alpha: 1)
UITabBar.appearance().barTintColor = UIColor(red: 65 / 255, green: 65 / 255, blue: 65 / 255, alpha: 1)
UITabBar.appearance().unselectedItemTintColor = .white
}
This works but the bar at the bottom of the screens is still black, making it difficult to see. Can I change the color of the bar to be white with SwiftUI and if so, how?
Additionally, does the bar at the bottom have a name? Googling has been difficult with not knowing a proper name for it.
2
Can I change the color of the bar to be white with SwiftUI and if so, how?
You cannot specify its color in code. You can, however, use the color behind the indicator to affect its appearance. Here is a good article that discusses its behavior in detail.
does the bar at the bottom have a name?
Apple didn’t include an official name in their user onboarding tutorials. In a UIKit API, it is referred as the “home indicator” or “visual indicator”.
Some other common names used by online postings are home bar, drag bar, home grabber, “the pill”, etc.
For its Apple private API names, use SBHomeGrabberView
or MTLumaDodgePillView
.