问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/25894974/how-can-i-fix-the-tab-bar-of-the-tab-bar-controller-in-ios