且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

WatchKit图像动画等待完成

更新时间:2022-12-26 18:48:36

您必须创建一个与动画持续时间相同的计时器,并等待计时器触发以了解WatchKit动画何时结束。

You have to create a timer that is the same duration as the animation and wait for the timer to fire to know when the WatchKit animation has finished.

以下是Apple在Apple开发论坛上对此问题的回复。

Here is Apple's response to this question on the Apple dev forums.


目前还不知道动画何时结束,因为
我们还没有在WatchKit的API中公开完成处理程序。如果您愿意,请在 http://bugreport.apple.com 上提交
增强请求
看到添加的内容。过去,您可以使用所描述的方法,
只是意识到它可能无法在所有
情况下工作。您可以选择更改您的用户界面,如果您需要它,
始终是现货。

There is not a way to currently know when an animation has ended, as we haven't exposed a completion handler in WatchKit's API. Please file an enhancement request at http://bugreport.apple.com if you'd like to see something added. Past that, you can use the method described, just be aware that it may not work as you like under all circumstances. You may choose to alter your UI if you need need it to always be spot on.

您可以阅读完整请点击此处 https://devforums.apple.com/message/1087798#1087798 。基本上使用计时器并不完美,但它是你***的。

You can read the full thread here https://devforums.apple.com/message/1087798#1087798. Basically using a timer isn't perfect, but it is the best you have.