Tab bar item completely filled!

Hey there,


I have an application with two tab bar items in a tab bar controller.

I created an item for the view "About" portrary a blue info ℹ︎ with a blue cirlce around it.

If the button is selected it displays an white info ℹ︎ with a blue filled circle. -> But this doesn't work!


Xcode makes always a blue filled circel without the info ℹ︎!

It appears in Storyboard but also in Simulator.


I think this is like an automatic mechanism for filled items, but I'm missing the info ℹ︎!


Anyone an idea what to do?


Unfortunately it is not possible to post an image but I hope you understand what I mean.


Thank you!

Accepted Reply

By default, your image is treated as a template image. That means the colors in the image are ignored, and only the alpha (transparency) value of each pixel is used.


You should normally design images that use only one color, and is fully transparent in any pixel that shouldn't have this color.


If you want to do something more complicated (for example, provide non-template images for the unselected and selected states yourself), you should read the documentation:


https://developer.apple.com/documentation/uikit/uitabbaritem


under the heading "Customizing Appearance", and then following the links to related documentation. (This is likely to be a bit of an adventure, which is why it's easier just to stick with a template image.)

Replies

By default, your image is treated as a template image. That means the colors in the image are ignored, and only the alpha (transparency) value of each pixel is used.


You should normally design images that use only one color, and is fully transparent in any pixel that shouldn't have this color.


If you want to do something more complicated (for example, provide non-template images for the unselected and selected states yourself), you should read the documentation:


https://developer.apple.com/documentation/uikit/uitabbaritem


under the heading "Customizing Appearance", and then following the links to related documentation. (This is likely to be a bit of an adventure, which is why it's easier just to stick with a template image.)

Thank you for the help and the explanation!

I just "cut of" the i so it gets transparetcy to zero and it now works!