Glow 技术团队博客
  • Home
Sign in Subscribe

cadisplaylink

A collection of 1 post
ios

使用CADisplayLink实现果冻效果动画

CADisplayLink是什么 根据Apple的doc: A CADisplayLink object is a timer object that allows your application to synchronize its drawing to the refresh rate of the display. 比起NSTimer,CADisplayLink可以确保系统渲染每一帧的时候我们的方法都被调用,从而保证了动画的流畅性。 Demo 我们希望在animate一个view的时候给它加上果冻效果: 我们会把所有的逻辑都封装到一个BlockView里,在这个view里首先申明一个property: @property (strong, nonatomic) CADisplayLink *displayLink; 在动画开始的时候,初始化displayLink,指定tick方法: - (void)startAnimation { if (self.displayLink == nil) { self.
  • leo
    leo
leo 13 Mar 2015 • 2 min read
Page 1 of 1
Glow 技术团队博客 © 2025
Powered by Ghost