In diesem Code benutze ich animation.But zu einer Zeit muss ich den Bild Alpha-Wert auch ändern.Wie kann man den Bild-Alpha-Wert mit Animation in ios sdk erhöhen oder verringern?
-(void)animation
{
CGPoint point = CGPointMake(imgView.frame.origin.x, imgView.frame.origin.y);
imgView.layer.position = point;
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"position.x"];
anim.fromValue = [NSValue valueWithCGPoint:point];
anim.toValue = [NSValue valueWithCGPoint:CGPointMake(point.x + 50, point.y)];
anim.duration = 10.0f;
anim.repeatCount =1;
anim.removedOnCompletion = YES;
anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
[imgView.layer addAnimation:anim forKey:@"position.x"];
imgView.layer.position = point;
}
Danke dude..Für Ihren Vorschlag.Jetzt habe ich es. – raja
@ user2545298: Mit Vergnügen :) –
hi..Also eine weitere Anforderung ist, wenn das Bild ändert es ist x-Position Alpha-Wert sollte sinken, dass bedeutet, dass Bild wird heller gesehen.Nach dem es kam zur nächsten Position Bild sollte heller sein. Vielen Dank im Voraus, wenn Sie eine Lösung für mich haben. – raja