Guest User

Untitled

a guest
Jul 18th, 2012
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. UIView animation not going back to original state
  2. [UIView beginAnimations:nil context:NULL];
  3. [UIView setAnimationRepeatCount:2];
  4. [UIView setAnimationRepeatAutoreverses:YES];
  5. [UIView setAnimationDuration:0.3];
  6. [UIView setAnimationBeginsFromCurrentState:YES];
  7. textDetailView.layer.backgroundColor = [UIColor colorWithRed:0 green:1 blue:0 alpha:0.3].CGColor;
  8. [UIView commitAnimations];
  9.  
  10. CABasicAnimation *myColorAnimation = [CABasicAnimation animationWithKeyPath:@"backgroundColor"];
  11. [myColorAnimation setAutoreverses:YES];
  12. [myColorAnimation setRepeatCount:2];
  13. [myColorAnimation setDuration:0.3];
  14. [myColorAnimation setToValue:(id)[myColor CGColor]];
  15. // the default "from value" is the current value
  16. [[textDetailView layer] addAnimation:myColorAnimation forKey:@"myColorKey"];
Advertisement
Add Comment
Please, Sign In to add comment