设置标签栏IOS的图像 [英] Set image for tab bar IOS

查看:50
本文介绍了设置标签栏IOS的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试为我的iOS应用程序的选项卡栏项图标设置png图像时遇到问题.如果我正在创建png图像(具有透明背景)并进行设置,那么一切都会按预期进行,但是当我使用另一个png文件(由其他人创建或从网络下载)时,它将无法正常工作.实际上,以我为例,我是从.pdf文件制作png文件,对于我来说,这是绝对不清楚的原因.有关更多信息,请参见下面的屏幕截图(顶部图像表示无法正常工作).

I'm experiencing issue when trying to set png image for tab bar item icon for my iOS application. 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. Actually in my case I'm making png file from .pdf file and it's absolutely not clear for me why this not works. For more information please see screen captures below (top image represents not working one).

谢谢.

推荐答案

这些特定的图标/按钮在PNG和这些图像的透明度方面都非常时髦.您必须查看在图像预览中下载的png,确保空白存在透明性.如果存在空格,它将通过并显示在您的iOS应用中.任何其他非白色透明度将显示为暗.第一次遇到此问题使我感到震惊,您从互联网上下载的许多图形和PNG都没有内置透明性,或者它们非常微妙.这些将显示为ViewController标签的Blob.

Those specific icons/buttons work funky in terms of PNG and transparency for those images. You have to have look at the png's you download in image preview, make sure transparency exists for the white space. If there is whitespace it'll come through and show in your iOS app. Any other nonwhitepsace transparency will show up dark. 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. THose will show up as a blob for your ViewController Tabs.

这里是我找到的很好的资源和指南: http://steveweller.com/articles/toolbar-icons/

Here is a good resource and guideline I found: http://steveweller.com/articles/toolbar-icons/

这篇关于设置标签栏IOS的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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