iPhone 3g 和 iPhone 4 分辨率最佳实践

发布于 10-06 09:35 字数 407 浏览 1 评论 0原文

我们的图形人员刚刚给了我我们正在构建的应用程序的切片图像,但他只给了我 960x640 iPhone 4 分辨率。

并建议我可以在运行时将图像缩小为 3g,因此分辨率/图像大小保持不变,但仅以一半大小显示。

问题:提交到应用程序商店时是否允许这样做,或者是否需要例如:

[电子邮件受保护] (460x640) - iPhone 4

IMAGE1.PNG (230x320) - iPhone 3g

适用于所有图像。

我可能只是进行批量转换,并为所有图像设置两种分辨率,以节省最大空间。

Our graphics guy just gave me the sliced images for an Application we're building, but he only gave me the resolution for the 960x640 iPhone 4 res.

And advised that I can just scale the images down for 3g at runtime, so the resolution/image size remains the same but it's just displayed at half size.

The question: Is this allowed when submitting to the app store, or is it a requirement to have for example:

[email protected] (460x640) - iPhone 4

IMAGE1.PNG (230x320) - iPhone 3g

For all images.

I might just do the batch conversion and have two resolutions for all images, to save maximum space.

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

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

发布评论

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

评论(3

夜光2024-10-13 09:35:44

这是允许的,但显然,图像在旧设备上占用的 RAM 是旧设备上的四倍,像素也是旧设备的四倍。 iPhone 4 拥有 512mb 内存,而 3G 版和初代只有 128mb。尽管假设您正确处理内存警告并且所有内容仍然适合,但主要的副作用将是每当清除内容并稍后从磁盘重新加载时出现性能问题(我确信您知道,会自动处理以供查看) NIB 中的控制器)。根据经验观察,3GS 之前的设备上的闪存比后来的设备慢很多,因此即使您坚持使用大图像,尝试最小化磁盘大小也是有意义的。

That's allowed, but obviously the images will occupy four times as much RAM on the older devices than they otherwise would, having four times the pixels. While the iPhone 4 has 512mb of RAM, the 3G and the original have just 128mb. Though assuming you are dealing with memory warnings correctly and everything will still fit, the main side effect will be performance issues whenever things are purged and later reloaded from disk (which, as I'm sure you're aware, is handled automatically for view controllers in NIBs). Based on empirical observations, the flash memory on pre-3GS devices is a lot slower than the later stuff so even if you're sticking with the large images it would make sense to attempt to minimise on-disk size.

仲春光2024-10-13 09:35:44

对我来说最有效的做法是制作视网膜图像,然后将其缩小 50%。

为了让视网膜显示器使用更大的图像,@2x 必须与更大的图像分开。你的例子就是它应该使用的方式。

Best practice that has worked for me is to make my retina image, then scale it down by 50%.

In order for the retina display to use the larger image, the @2x MUST be apart of the larger image. Your example is the way it should be used.

月亮是我掰弯的2024-10-13 09:35:44

我肯定会提前进行批量扩展。如果没有其他原因,iPhone 选择是否显示 IMAGE1.PNG 或 [电子邮件受保护] 取决于屏幕的分辨率。在您的代码中,您始终只引用 IMAGE1.PNG。您不必进行任何编码更改。如果您在运行时缩放它们,您将必须覆盖对任何 UIImage 类型事物的所有调用。

恕我直言,您可能会错过一个,否则苹果可能会发布不同配置的手机,这将导致您必须重新编写所有检查屏幕分辨率的代码。

I would do the batch scaling ahead of time for sure. If for no other reason than the iPhone chooses whether or not to display the IMAGE1.PNG or the [email protected] depending on the resolution of the screen. In your code you always just reference IMAGE1.PNG. You don't have to make any coding changes. If you scale them at runtime you will have to override all of your calls to any UIImage type of thing.

IMHO, You are likely to miss one or else Apple is likely to release a different configuration of phone that will cause you to have to rework all of your code that is checking for screen resolution.

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