Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to FlipFromLeft?

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];

i wanna Flip the containerView,but it doesn't work.

like image 655
Wang Yanchao Avatar asked Apr 23 '26 15:04

Wang Yanchao


1 Answers

This is a similar post about the same problem. @Jason Harwig suggests that you try:

Try using self.view.superview in the animation transition view of the showMoreInfo:

EDIT: Looking at another post, it seems as though adding the subview BEFORE commiting the animations is the problem. Why don't you try that?

Hope that Helps!

like image 54
msgambel Avatar answered Apr 25 '26 05:04

msgambel