开发者

Swapping NSViews using a push transition

I've been trying to figure this out for a while but I can't seem to get it. How would I swap two NSViews using a push transition (like what UINavigationController does on iOS)? What I've tried so far:

  • Using an NSAnimation subclass <-- too slow
  • Using NSViewAnimation and MGViewAnimation <-- too slow
  • Using the NSView animator proxy <-- too slow
  • Using CATransition <-- I can't use this because 开发者_如何学编程CATransition requires the views to be layer backed, and layer backing views causes text rendering glitches as well as various other graphical artifacts


The first 3 options are probably too slow because you're trying to use them without layer-backing your views. To do animation in AppKit, you're going to need to have your views backed by layers.


It seems that the animation is slow because I'm animating a pretty large view. I don't think there's any way around that other than the good old image swap trick (taking an image of the view and animating that instead of the view itself).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜