Xcode 8 导入 pdf(矢量)介绍图像资产无法正常工作 [英] Xcode 8 import pdf (vector) intro image assets not working well

查看:19
本文介绍了Xcode 8 导入 pdf(矢量)介绍图像资产无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拖动 pdf 介绍图像资产(通用)并构建 Xcode.

没有生成 png@2 png@3 .(仅PDF)

我遵循本教程:

Xcode 6、7 工作......也许PDF文件需要优化?!

在研究中,我发现svg 的大小并不重要",但在这种情况下(我对其进行了测试).

解决方案

不确定这是否有帮助,但从我读到的内容来看,Xcode 并不完全支持矢量图形.听起来您无法加载矢量图像 (.pdf) 并且可以根据需要进行缩放.相反,无论您的 .pdf 的默认大小是多少,它都会假定为 1x 大小,然后缩放 pdf 以在构建时自动创建 2x 和 3x 图像.因此,它实际上并没有缩放原始文件,只是创建了 pdf 原始大小的 1x、2x 和 3x png.从我正在阅读的内容来看,人们认为这样做是为了保持向后兼容性.我找不到任何说明它在 Xcode 8 中发生变化的内容,所以我假设它仍然以相同的方式工作.

这个问题似乎回答得很好:How矢量图像在 Xcode 中工作吗(即 pdf 文件)?

希望我能帮上忙.

I drag pdf intro image assets (universal) and building Xcode.

There is no generated png@2 png@3 . (only Pdf)

I follow this tutorial : https://icons8.com/articles/how-to-use-vectors-in-xcode-7/

When I start app on the device images are so bad quality...

Xcode 6, 7 working .... Maybe PDF file needs optimisation ?!

In research I found "size of svg is not important" but in this case it is (I test it).

解决方案

Not sure if this helps, but from what I was reading about this, Xcode doesn't fully support vector graphics. It sounds like instead of you being able to load a vector image (.pdf) and it scales however necessary. Instead, whatever the default size of your .pdf is, it'll assume that is the 1x size, then scale the pdf to automatically create the 2x and 3x image when it's built. So its not actually scaling the original, just creating a 1x, 2x, and 3x png of the original size of your pdf. From what I'm reading, people are thinking this is done to maintain backwards compatibility. I couldn't find anything that says it has changed in Xcode 8, so I'm assuming it still works the same way.

This question seems to answer it well: How do vector images work in Xcode (i.e. pdf files)?

Hope I was able to help.

这篇关于Xcode 8 导入 pdf(矢量)介绍图像资产无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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