我想在一定程度上将 UIImageview 从 A 点移动到 B 点。红色和蓝色箭头表示我希望点移动的程度。
我可以将点从一个点移动到另一个点,但是如何将音符移动一个度数?
NSLog(@"cgpoint %@",NSStringFromCGPoint(self.aggressiveDots.frame.origin));
CAKeyframeAnimation *anim = [CAKeyframeAnimation animationWithKeyPath:@"position"];
NSArray *times = [NSArray arrayWithObjects:[NSNumber numberWithFloat:0.0], nil];
[anim setKeyTimes:times];
NSArray *values = [NSArray arrayWithObjects:[NSValue valueWithCGPoint:CGPointMake(118, 188.)],
[NSValue valueWithCGPoint:CGPointMake(115, 300.)], nil];
[anim setValues:values];
[anim setDuration:6.0]; //seconds
[self.redDots.layer addAnimation:anim forKey:@"position"];