PayPal 如何将 UI 元素和图像资源合并到 iPhone 静态库中?

发布于 2024-09-15 20:24:55 字数 312 浏览 3 评论 0原文

我正在尝试制作一个类似于 PayPal 所做的静态库(https:/ /www.x.com/community/ppx/xspaces/mobile/mep)(适用于 iPhone)。

看起来 PayPal 能够将视图以及图像资源集成到库中。我能想到的唯一解决方案是为 UI 手动编写 UI 代码并为图像资源生成二进制数据。这两个对我来说看起来都很丑陋。关于如何将 UI 和图像资源合并到静态库中还有其他想法吗?

I am trying to make a static library similar to what PayPal has done (https://www.x.com/community/ppx/xspaces/mobile/mep) for the iPhone.

It looks like PayPal is able to integrate views into the library as well as image resources. The only solution I can think of is to code the UI by hand for the UI and produce binary data for the image resources. Both of these seem very ugly to me. Any other ideas on how to incorporate UI and image resources into a static library?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦在深巷 2024-09-22 20:24:55

如果您lipo -thinar -t PayPal 的库,您可以看到库中除了.o 文件之外什么都没有。他们要么从互联网获取图像,要么将它们编码并编译为 C 数组。

If you lipo -thin and ar -t PayPal's library you can see that there is nothing but .o files in the library. They are either getting the images from the internet or encoding and compiling them as C arrays.

肩上的翅膀 2024-09-22 20:24:55

答案是简单地将资源与静态库分开传送。为了方便起见,您可能希望将它们打包为捆绑包。然后,您的库的用户只需将静态库和捆绑包添加到他们的项目中即可。

The answer is to simply ship the resources separately from the static library. For convenience you may want to package them as a bundle. Then, the user of your library simply adds the static library and the bundle to their project.

反差帅 2024-09-22 20:24:55

他们也有可能只是用 Quartz2D 绘制图像。绘图程序 Opacity 除了可以输出其他图像格式外,还可以输出 Quartz2D 代码:

http://likethought.com/opacity/

It is also possible they are simply drawing the images with Quartz2D. The drawing program Opacity can output Quartz2D code in addition to other image formats:

http://likethought.com/opacity/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文