UIImageView * frontImageView = [[UIImageView alloc] initWithImage:[UIImage
imageNamed:@"view.png"]];
UIView * containerView = [[UIView alloc] initWithFrame:frontImageView.bounds];
containerView.center = self.view.center;
[self.view addSubview:containerView];
[containerView addSubview:frontImageView];
UIImageView * backImageView = [[UIImageView alloc] initWithImage:[UIImage
imageNamed:@"view.png"]];
backImageView.center = frontImageView.center;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
forView:containerView
cache:YES];
[frontImageView removeFromSuperview];
[containerView addSubview:backImageView];
[UIView commitAnimations];
我想翻转容器视图,但它不起作用。