iOS 4. UITouch 的 locationInView 不承认视网膜显示。错误还是功能?

发布于 2024-12-17 23:12:49 字数 106 浏览 3 评论 0原文

UITouch 的 locationInView: 不知道视网膜显示器的存在(或不存在)是否有原因?为什么视网膜显示的重新缩放成为开发人员的任务。我觉得很奇怪。

谢谢,
道格

Is there a reason that UITouch's locationInView: is unaware of the presence (or not) of a retina display? Why is the rescaling for retina display left as a task for the developer. Seems odd to me.

Thanks,
Doug

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

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

发布评论

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

评论(1

治碍 2024-12-24 23:12:49

这是设计使然。位置以点为单位报告,而不是以像素为单位。来自 Apple 的事件处理指南:

iOS 4.0 仍然在 320x480 坐标空间中报告 iPhone 4(以及未来的高分辨率设备)上的触摸,以保持源兼容性,但对于为 iOS 4.0 及更高版本构建的应用程序,每个维度的分辨率都高两倍。

It's by design. The location is reported as in points, not as in pixels. From Apple's Event Handling Guide:

iOS 4.0 still reports touches on iPhone 4 (and on future high-resolution devices) in a 320x480 coordinate space to maintain source compatibility, but the resolution is twice as high in each dimension for applications built for iOS 4.0 and later releases.

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