简体   繁体   English

UITabBar图像不清楚

[英]UITabBar Image is not clear

I just recently got a new set of icons for my app (from an external designer) and I am trying to implement them, but for some reason it ends up looking like this (the new icon is the one in the middle): 我刚从外部设计师那里为我的应用程序获得了一组新图标,并且正在尝试实现它们,但是由于某种原因,它最终看起来像这样(新图标位于中间):

在此处输入图片说明

I have tried setting the image of the tab bar to have UIImageRenderingModeAlwaysOriginal , but that's given me no luck. 我尝试将选项卡栏的图像设置为具有UIImageRenderingModeAlwaysOriginal ,但是这给我带来了不小的运气。

Here's the icon (it kind of blends into the background but its a white envelope): 这是图标(它融合到背景中,但带有白色信封):
在此处输入图片说明

Any reason why this is happening and how I can fix? 发生这种情况的任何原因以及如何解决?

The problem is that the entirety of your image is opaque - at least part of it needs to be transparent to appear as you want it to. 问题在于图像的整体是不透明的 -至少部分图像需要透明才能显示为您想要的样子。

In the below image (since the entire thing is white now, it's directly below this text), I have removed the black line and made that transparent. 在下面的图像中(由于整个事情现在是白色的,因此它直接位于该文本的下面),我删除了黑线并使之透明。 I then added this image to a tab bar, and it worked fine for me. 然后,我将此图像添加到选项卡栏,对我来说效果很好。

邮件图标

Here's the link to the image , as well. 这也是指向图像链接

我最后要做的是使用awakeFromNib方法中的选项卡图像使用UIImageRenderingModeAlwaysOriginal设置...似乎可以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM