6
這可能嗎?我可以改變圖層的不透明度和位置(中心),但每當我嘗試更改大小或原點時,它都不起作用。使用核心動畫調整大小和移動UIView(CAKeyFrameAnimation)
CAAnimationGroup* anigroup = [CAAnimationGroup new];
CGMutablePathRef thePath = CGPathCreateMutable();
CGPathAddRect(thePath, NULL, CGRectMake(0,0, 320, 480));
CGPathAddRect(thePath, NULL, CGRectMake(location.x - 16,location.y-24, 32, 48));
CGPathAddRect(thePath, NULL, CGRectMake(190, 20, 32, 48));
CAKeyframeAnimation* AniLoc = [CAKeyframeAnimation animationWithKeyPath:@"frame"];
AniLoc.path = thePath;
AniLoc.keyTimes= [NSArray arrayWithObjects:[NSNumber numberWithFloat:0.0f],
[NSNumber numberWithFloat:0.3f],
[NSNumber numberWithFloat:1.0f],nil];
AniLoc.duration = 5;
CFRelease(thePath);
anigroup.animations = [NSArray arrayWithObjects:AniLoc,nil];
anigroup.duration = 5;
[focusview.layer addAnimation:anigroup forKey:nil];
太棒了,這正是我一直在尋找的。謝謝! – ACBurk 2009-12-11 16:33:36