iOS Many Images - 保持良好的性能
我有一个 iOS 应用程序,您可以在其中拖动许多图像并旋转它们。它就像一个儿童应用程序,您可以使用不同的部件(车轮、车灯等)来建造自己的汽车。我的计划是为每个图像使用 UIImageview 并允许旋转等。但是,在我这样做之前,我想知道是否有人对是否有更好(更有效)的方法有任何想法?或者使用 UIImageViews 是这里唯一的选择吗? (它必须是预先设计的图像,所以我不是在谈论用 Quartz 创建对象并用颜色填充它们)。
I have an iOS app where you can drag many images and rotate them. Its like a childrens app where you might build your own car using different parts (wheels, lights, etc.). My plan is to use a UIImageview for each image and allow rotations etc. Before I do so however, I am wondering if anyone has any thoughts on if there is a better (more efficient) approach? Or is using UIImageViews the only option here? (It must be pre-designed images, so im not talking about creating objects with Quartz and filling them with color).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您仍然可以使用带有图像的石英。当图像的某些部分不经常更改时,这将是一个有用的选项;你不需要一直重画。
如果您有大量图像/操作,UIImageViews 将变得相对较慢并消耗大量内存。此外,图层操作(例如缩放/旋转)看起来不如使用石英生成的操作好。如果是简单的情况,则测试 UIImgeViews。
you can still use quartz with images. it will be a useful option when portions of you images do not change often; you'll not need to redraw all the time.
UIImageViews will become relatively slow and consume a good amount of memory if you have a lot of images/manipulations. furthermore, the layer operations (e.g. scale/rotate) don't look as good as ones you can produce using quartz. if it's a simple case, then test UIImgeViews.
OpenGL ES 可以为您提供一些显示图片的方法,但我认为带有 Core Graphics 的 UIImage 就可以很好地工作。我在屏幕上添加了大约 100 张图片(是的,是小图片)并滚动它们。在3GS上很顺利,这是我当时能使用的最弱的设备。
所以我猜你可以押注于 UIImageView。
OpenGL ES can provide you with some methods to show pics, but I think that UIImage with Core Graphics will work just fine. I've added about 100 pic (small ones, yes) to the screen and scrolled them. Smoothly on 3GS, the weakest device that I was able to use that time.
So you can bet on UIImageView, I guess.