How can I fix the tab bar of the tab bar controller in iOS?

I am adding my own image icon in the bottom of the tab bar, but it only shows a grey square and the title.

How can I fix this?

Upvotes: 0

Views: 425

Answers (1)

matt
matt

Reputation: 534893

The problem is that your image lacks transparency. The tab bar expects your image to be a transparency mask (also called a template) - only its degree of transparency / opacity is taken into account. Your image is completely solid opaque, so it appears as a solid square.

Either fix your image, or derive from it an image whose rendering mode is Always Original to force that actual drawing of the image to appear instead of its opacity.

Upvotes: 4

Related Questions