简体   繁体   English

如何将资产包含在框架中?

[英]How to include asset in a framework?

I want to add a new xcassets folder into my framework (there is already xcassets in this framework).我想在我的框架中添加一个新的 xcassets 文件夹(这个框架中已经有 xcassets)。

I have four targets:我有四个目标:

  • one for the projet (workspace) which I build every day for the development一个用于我每天为开发构建的项目(工作区)
  • one for the tests一个用于测试
  • one for the SDK, which includes all header, xcassets, files, etc.一个用于 SDK,其中包括所有标头、xcassets、文件等。
  • one to build the SDK一个构建SDK

在此处输入图像描述

I checked the SDK target on the target membership view (when I'm on the xcassets folder).我在目标成员视图中检查了 SDK 目标(当我在 xcassets 文件夹中时)。 I add the xcassets folder in the build phase (like it was for the other).我在构建阶段添加了 xcassets 文件夹(就像其他文件夹一样)。

Now, what I'm missing?现在,我缺少什么?

Here the screenshots: The assets folder这里的截图:资产文件夹在此处输入图像描述

The project该项目在此处输入图像描述

The SDK开发工具包在此处输入图像描述

The SDK Builder SDK 构建器在此处输入图像描述

You need to include the assets in the Project's (not the SDK) Targets - BuildPhase - CopyBundleResources .您需要将资产包含在项目(而非 SDK)的Targets - BuildPhase - CopyBundleResources中。 I'm not quite sure but you probably need to make sure it has a unique name.我不太确定,但您可能需要确保它有一个唯一的名称。 ie If the project has Assets.xcassets, name yours something else.即,如果项目有 Assets.xcassets,请为您的项目命名。

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

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