Objective-C 中 NSImageView 之间的转换
我对 Mac OS X API 不太熟悉(来自 iPhone sdk 的长期背景),我想知道如何在切换 nsimageviews 时添加过渡。有谁可以分享一段简短的代码片段来说明如何执行此操作吗?
I am not very familiar with the Mac OS X APIs (coming from a long background of iPhone sdk) and I was wondering how I could add a transition when I switch nsimageviews. Does anyone have a short code snippet they can share about how to go about doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
本教程做了几乎相同的事情,尽管有一些您可能不需要的额外内容:http://www.cimgf.com/2008/03/03/core-animation-tutorial-wizard-dialog-with-transitions/
简而言之,只需调用
即可对两个视图执行交叉淡入淡出动画。如果您想做不同类型的动画,教程中的第四个代码块应该会有帮助。
请注意,使用核心动画层会破坏字体渲染,因此您可能还需要在动画完成后
setWantsLayer:NO
。This tutorial does pretty much the same thing, albeit with some extra things you probably don't need: http://www.cimgf.com/2008/03/03/core-animation-tutorial-wizard-dialog-with-transitions/
In short, just call
to do a crossfade animation of the two views. If you want to do a different type of animation, the fourth block of code in the tutorial should be of help.
Be warned that using Core Animation layers ruins your font rendering, so you'll probably want to
setWantsLayer:NO
after the animation is complete also.