When I set the background color of a UITabBar
iOS automatically lightens this color since the default UITabBar
is translucent.
But I would like to use a UITabBar
which is NOT translucent. In iOS 12 and below I solved this by setting a background image of the desired color:
// Create an image from a given color using a custom extension
[[UITabBar appearance] setBackgroundImage:[UIImage colorImageWithColor:[UIColor redColor]]];
This works fine. However, I would like to use the new Dark Mode in iOS 13. Obviously this cannot be done when using a colored background image instead of a background color. Instead not without reacting manually to the appearance change to switch to another color image.
Using named colors would be way better IF it would be possible to tell iOS not to draw the `UITabBar translucent.
If I try to disable the translucent effect the UITabBar
become all white instead of the specified color.
[[UITabBar appearance] setTranslucent:false];
How to solve this?