iphone UIView animation
//Flips to back when toggle button is pressed
- (IBAction)toggleView:(id)sender {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
forView:[self view]
cache:YES];
[[self view] addSubview:secondaryView];
[UIView commitAnimations];
}
//Flips to front when "Done" is pressed
- (IBAction)returnView:(id)sender {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
forView:[self view]
cache:YES];
[secondaryView removeFromSuperview];
[UIView commitAnimations];
}
- (IBAction)toggleView:(id)sender {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
forView:[self view]
cache:YES];
[[self view] addSubview:secondaryView];
[UIView commitAnimations];
}
//Flips to front when "Done" is pressed
- (IBAction)returnView:(id)sender {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
forView:[self view]
cache:YES];
[secondaryView removeFromSuperview];
[UIView commitAnimations];
}
浙公网安备 33010602011771号