presentationLayer 位置属性在 iPad 上产生错误值,但在 iPhone 上没有问题

发布于 2024-08-28 05:22:58 字数 514 浏览 2 评论 0原文

我有一个游戏,其中有几个使用 CAKeyframeAnimation 进行动画处理的小对象。对象动画完美适用于 iPhone 和 iPad。然而,动画 CALayers 的presentationLayers 的position 属性值仅在iPhone 上产生合理的值。我使用动画对象的当前位置进行命中测试。 iPad 和 iPhone/iPod Touch 在这方面有什么不同吗?

iPhone 的位置点显示了随着对象动画而发生的预期增量变化;在 iPad 上我看到了特殊的值,例如这个序列: <-36893488147419103232.000000,2.607987>, <-0.000000,2.658927>, <0.000000,2.709929>, <36893488147419103232.000000,2.755450>, ...

presentationLayer 的其他属性是正确的(但是,这些属性的值在动画期间不会更改)。

动画完成后,presentationLayer 位置值是准确的。

I have a game with several small objects animated using CAKeyframeAnimation. Objects animate perfectly for BOTH iPhone and iPad. However, the value of the position property of the animated CALayers' presentationLayers only yield reasonable values on the iPhone. I use the current position of the animating objects for hit testing. Any ideas of differences in this area between iPad and iPhone/iPod Touch?

The position points for iPhone show expected incremental change as objects animate; on iPad I see peculiar values, for example this sequence:
<-36893488147419103232.000000,2.607987>,
<-0.000000,2.658927>,
<0.000000,2.709929>,
<36893488147419103232.000000,2.755450>, ...

Other properties of the presentationLayer are correct (these are properties whose values don't change during the animation, however).

After the animation finishes, the presentationLayer position value IS accurate.

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

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

发布评论

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

评论(1

无风消散 2024-09-04 05:22:59

这里有完全相同的问题!看起来这是一个从 3.2 版本的 SDK 开始的错误...
实际上我做了一个 iPhone 应用程序(使用 3.1 SDK),它完全基于 CAAnimation,当我在 3.2 的 iPhone 上安装并运行该应用程序时,没有任何效果!!!...但在 3.1 的设备上完美运行。我用谷歌搜索,发现另一个人也有完全相同的问题。

看看下面论坛的底部

http://www.iphonedevsdk.com/forum/iphone-sdk-development/19622-current-position-animating-calayer.html

您能解决此问题或找到解决方法吗?

Exactly same problem here!! and it looks that is a bug starting with 3.2 version of the SDK...
Actually I did a iPhone app (using 3.1 SDK) that it is completely based on CAAnimation, when I installed and ran the the app on an iPhone with 3.2 nothing works!!!... but on devices that has 3.1 works perfectly. I google it and I found another people with exactly the same problem.

take a look at the bottom of the following forum

http://www.iphonedevsdk.com/forum/iphone-sdk-development/19622-current-position-animating-calayer.html

Could you solved this issue or found a workaround?

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