Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UIView animation not going back to original state
- [UIView beginAnimations:nil context:NULL];
- [UIView setAnimationRepeatCount:2];
- [UIView setAnimationRepeatAutoreverses:YES];
- [UIView setAnimationDuration:0.3];
- [UIView setAnimationBeginsFromCurrentState:YES];
- textDetailView.layer.backgroundColor = [UIColor colorWithRed:0 green:1 blue:0 alpha:0.3].CGColor;
- [UIView commitAnimations];
- CABasicAnimation *myColorAnimation = [CABasicAnimation animationWithKeyPath:@"backgroundColor"];
- [myColorAnimation setAutoreverses:YES];
- [myColorAnimation setRepeatCount:2];
- [myColorAnimation setDuration:0.3];
- [myColorAnimation setToValue:(id)[myColor CGColor]];
- // the default "from value" is the current value
- [[textDetailView layer] addAnimation:myColorAnimation forKey:@"myColorKey"];
Advertisement
Add Comment
Please, Sign In to add comment