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

一个人想着一个人 提交于 2019-12-02 17:04:12

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!