简体   繁体   English

设置标签栏IOS的图像

[英]Set image for tab bar IOS

I'm experiencing issue when trying to set png image for tab bar item icon for my iOS application. 我在尝试为我的iOS应用程序设置标签栏项目图标的png图像时遇到问题。 If I'm creating png image (with transparent background) and setting it, everything works as expected, but when I'm using another png file (created by another person, or downloaded from web) it not works. 如果我正在创建png图像(具有透明背景)并设置它,一切都按预期工作,但当我使用另一个png文件(由另一个人创建,或从网上下载)时,它不起作用。 Actually in my case I'm making png file from .pdf file and it's absolutely not clear for me why this not works. 实际上在我的情况下,我正在从.pdf文件制作png文件,我绝对不清楚为什么这不起作用。 For more information please see screen captures below (top image represents not working one). 有关详细信息,请参阅下面的屏幕截图(顶部图像表示不工作)。

在此输入图像描述在此输入图像描述

Thanks in advance. 提前致谢。

Those specific icons/buttons work funky in terms of PNG and transparency for those images. 这些特定的图标/按钮在PNG和这些图像的透明度方面起到了时髦的作用。 You have to have look at the png's you download in image preview, make sure transparency exists for the white space. 您必须查看在图像预览中下载的png,确保空白区域存在透明度。 If there is whitespace it'll come through and show in your iOS app. 如果有空格,它将通过你的iOS应用程序显示。 Any other nonwhitepsace transparency will show up dark. 任何其他nonwhitepsace透明度将显示为黑暗。 It threw me off the first time I encountered this, A lot of graphics and PNG's you download from the internet doesn't have transparency built in or they have it very subtle. 当我第一次遇到这个时,它让我失望了。你从互联网上下载的很多图形和PNG没有内置的透明度,或者它们非常微妙。 THose will show up as a blob for your ViewController Tabs. 这些将显示为ViewController选项卡的blob。

Here is a good resource and guideline I found: http://steveweller.com/articles/toolbar-icons/ 这是我发现的一个很好的资源和指南: http//steveweller.com/articles/toolbar-icons/

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

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