好久没写博客了,最近脑袋小乱。
这几天,公司不远处正大兴土木,工作的时候,时有震动,感觉连墙上的画像都在震动,又因身在四楼,多次以为是地震,准备往楼下窜⋯⋯奈何被领导的目光镇压。
因震有感,特此把墙上的画shack一下:
在前面有一篇博文:photoBrower Demo 相片效果 基础上添加如下而成。
- (IBAction)shackView { CABasicAnimation* anim = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; [anim setToValue:[NSNumber numberWithFloat:0.0f]]; [anim setFromValue:[NSNumber numberWithDouble:M_PI/64]]; [anim setDuration:0.1]; [anim setRepeatCount:NSUIntegerMax]; [anim setAutoreverses:YES]; [sview.layer addAnimation:anim forKey:@"SpringboardShake"]; }
工程Demo
转自:http://pimacun.72pines.com/2011/06/08/%E5%9C%B0%E9%9C%87%E4%BA%86%EF%BC%9Ashackview/