标签栏图标看不到

Tabbar icon not able to see

我把这个图标放到了标签栏上,但是在设备上我只能看到一个灰色的矩形。我是否应该以某种方式改变我的图像才能看到它?

By default, the actual unselected and selected images are automatically created from the alpha values in the source images. To prevent system coloring, provide images with UIImageRenderingModeAlwaysOriginal.

图片必须具有透明背景的 1 色。除非您以编程方式分配图像并将图像的 renderingMode 设置为 AlwaysOriginal

var image : UIImage = UIImage(named:"myImage.png").imageWithRenderingMode(renderingMode: AlwaysOriginal)