xcode Assets.xcassets 和 images.xcassets 有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44873674/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What's difference between Assets.xcassets and images.xcassets?
提问by huangxinyu
When I new a xcode project, there was a image folder by defalut, I wanna to know that is there any difference between them? Is Assets.xcassets newer?
当我新建一个 xcode 项目时,defalut 有一个图像文件夹,我想知道它们之间有什么区别吗?Assets.xcassets 更新了吗?
回答by Itachi Uchiha
What is Asset?
什么是资产?
Asset catalogs to organize and manage the different asset types and image resolutions used by your app's user interface.
用于组织和管理应用程序用户界面使用的不同资产类型和图像分辨率的资产目录。
You can have multiple asset catalogsin your project and within each catalog, multiple sets of assets. In addition, you can organize sets into folders.The common types of sets you can add to a catalog are image, data, and texture sets.
您可以在项目中拥有多个资产目录,并且在每个目录中,可以拥有多组资产。此外,您可以将集组织到文件夹中。您可以添加到目录中的常见集类型是图像、数据和纹理集。
Now you understand that image asset is one of the asset catalog.
现在您了解图像资产是资产目录之一。
It will automatically created by Xcode when creating new projects.
创建新项目时,它会由 Xcode 自动创建。
Common use of Asset catalog :
资产目录的常见用途:
In particular, use asset catalogs to manage images that are required to launch your app on a device and submit your app to the App Store.
特别是,使用资产目录来管理在设备上启动您的应用程序并将您的应用程序提交到 App Store 所需的图像。
As above statements from apple there are multiple asset types are available.You can create catalog for each type if you want.
正如上面来自苹果的声明,有多种资产类型可用。如果需要,您可以为每种类型创建目录。
You can get more info from help.apple.com
您可以从help.apple.com获取更多信息
回答by Miguel Rojas Cortés
Not really sure but I think since Xcode 7 you have this new Assets.xcassets catalog to store several types of resources, not just images as you can have sounds, images, fonts and movies in your project.
不太确定,但我认为从 Xcode 7 开始,您有这个新的 Assets.xcassets 目录来存储多种类型的资源,而不仅仅是图像,因为您可以在项目中拥有声音、图像、字体和电影。