PayPal 如何将 UI 元素和图像资源合并到 iPhone 静态库中?
我正在尝试制作一个类似于 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您
lipo -thin
和ar -t
PayPal 的库,您可以看到库中除了.o
文件之外什么都没有。他们要么从互联网获取图像,要么将它们编码并编译为 C 数组。If you
lipo -thin
andar -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.答案是简单地将资源与静态库分开传送。为了方便起见,您可能希望将它们打包为捆绑包。然后,您的库的用户只需将静态库和捆绑包添加到他们的项目中即可。
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.
他们也有可能只是用 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/