下面是内存溢出 jb51.cc 通过网络收集整理的代码片段。
内存溢出小编现在分享给大家,也给大家做个参考。
- (voID)vIEwDIDLoad { [super vIEwDIDLoad]; // Do any additional setup after loading the vIEw,typically from a nib. UIVIEw *vIEw =[[UIVIEw alloc]initWithFrame:CGRectMake(100,100,100)]; vIEw.backgroundcolor =[UIcolor redcolor]; [self.vIEw addSubvIEw:vIEw]; [self heartbeatVIEw:vIEw duration:100];}-(voID)heartbeatVIEw:(UIVIEw *)vIEw duration:(CGfloat)fDuration{ [[self class] heartbeatVIEw:vIEw duration:fDuration maxSize:1.4f durationPerBeat:0.5f];}+(voID)heartbeatVIEw:(UIVIEw *)vIEw duration:(CGfloat)fDuration maxSize:(CGfloat)fMaxSize durationPerBeat:(CGfloat)fDurationPerBeat{ if (vIEw && (fDurationPerBeat > 0.1f)) { CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; CAtransform3D scale1 = CAtransform3DMakeScale(0.8,0.8,1); CAtransform3D scale2 = CAtransform3DMakeScale(fMaxSize,fMaxSize,1); CAtransform3D scale3 = CAtransform3DMakeScale(fMaxSize - 0.3f,fMaxSize - 0.3f,1); CAtransform3D scale4 = CAtransform3DMakeScale(1.0,1.0,1); NSArray *frameValues = [NSArray arrayWithObjects: [NSValue valueWithCAtransform3D:scale1],[NSValue valueWithCAtransform3D:scale2],[NSValue valueWithCAtransform3D:scale3],[NSValue valueWithCAtransform3D:scale4],nil]; [animation setValues:frameValues]; NSArray *frameTimes = [NSArray arrayWithObjects: [NSNumber numberWithfloat:0.05],[NSNumber numberWithfloat:0.2],[NSNumber numberWithfloat:0.6],[NSNumber numberWithfloat:1.0],nil]; [animation setKeyTimes:frameTimes]; animation.fillMode = kCAFillModeForwards; animation.duration = fDurationPerBeat; animation.repeatCount = fDuration/fDurationPerBeat; [vIEw.layer addAnimation:animation forKey:@"heartbeatVIEw"]; }else{}}
以上是内存溢出(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
总结以上是内存溢出为你收集整理的iOS类似心跳的动画缩放全部内容,希望文章能够帮你解决iOS类似心跳的动画缩放所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)