如何修复iOS中标签栏控制器的标签栏? [英] How can I fix the tab bar of the tab bar controller in iOS?

查看:121
本文介绍了如何修复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?

推荐答案

问题是您的图像缺乏透明度。标签栏要求您的图像是透明度蒙版(也称为模板) - 仅考虑其透明度/不透明度。您的图像完全是不透明的,因此它显示为实心方块。

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.

这篇关于如何修复iOS中标签栏控制器的标签栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆