Xcode 6资产目录自动创建较小比例的图像 [英] Xcode 6 asset catalog automatically create images for smaller scales

查看:131
本文介绍了Xcode 6资产目录自动创建较小比例的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于在iOS 8中需要3x图像,我认为使用Xcode 6中的资产目录来管理图像会更容易。我试图只提供单个图像,将3x缩放图像提供给资产目录,我想要Xcode自动缩小该图像以生成3x图像的2x和1x版本,因此我不必手动执行。

With the need of 3x images in iOS 8 I figured it would be easier to manage images with an asset catalog in Xcode 6. I am trying to just provide a single image, the 3x scaled image to the asset catalog and I want Xcode to automatically downscale that image to generate 2x and 1x versions of the 3x image, so that I don't have to do it manually.

现在这就是我有:

Right now this is what I have:

我真的希望Xcode具有自动创建2x和1x图像的功能,我还没有发现它。如果没有这样的功能,还有其他选择吗? (我知道IconKit,但它很烦人,并且还没有更新以支持3x图像。如果它在第一时间正确制作,它甚至不需要更新..)

I really hope that Xcode has such a feature to automatically create 2x and 1x images and I just have not discovered it yet. If there isn't any such feature, are there any alternatives? (I know IconKit but it is annoying and hasn't been updated to support 3x images. If it was made properly in the first place it wouldn't even need an update..)

我知道Xcode会自动生成矢量pdf中的所有图像,但这不是我想要的!

I know that Xcode automatically can generate all images from a vector pdf, but thats not what I am looking for!

推荐答案

<我最终制作了一个小型的应用程序来处理肮脏的工作。您可以将一个或多个.jpg或.png文件拖放到应用程序的主视图中;它将检测输入图像的比例并创建较小的缩放图像。有了这个应用程序,我只需要创建一个3x图像并将其拖动到应用程序中以创建两个较小的图像。它节省了大量工作!

I ended up making a small mac app that takes care of the dirty work. You can drag and drop one or multiple .jpg or .png files into the app's main view; it will detect the input image's scale and create the smaller scaled images. With this app I only need to create a single, 3x image and drag it into the app to create the two smaller images. It saves so much work!

可以在我的GitHub页面上找到源代码,只需下载并在Mac上运行即可! https://github.com/JonasGessner/ImageReducer

The source can be found on my GitHub page, simply download it and run it on your mac! https://github.com/JonasGessner/ImageReducer

这篇关于Xcode 6资产目录自动创建较小比例的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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