How to implement iPhone transition animations with display and scaling?

How can I implement the animation that we see on the screen of the iPhone iPhone app coverflow app? when you click on a small view, does it flip and scale to another view? How can i do this? I can use basic animation to flip and scale the view, but how can I go to another view? thanks

+5
source share
2 answers

You will need UIViewas a container for two UIView(frontside / backside), and then remove / add them from / to the container as subzones when performing animations between them:

UIView *flipContainer;
UIView *frontSide;
UIView *backSide;
  //...
-(void)turnUp
{
  [backSide removeFromSuperview];
  [UIView beginAnimations:nil context:NULL];
  [UIView setAnimationDuration:1.0];
  [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:flipContainer cache:YES];
  [UIView setAnimationDuration:1.0];
  CGAffineTransform transform = CGAffineTransformMakeScale(1.2, 1.2);
  flipContainer.transform = transform;
  [UIView commitAnimations];
  [flipContainer addSubview:frontSide];
}
-(void)turnDown
{
  [frontSide removeFromSuperview];
  [UIView beginAnimations:nil context:NULL];
  [UIView setAnimationDuration:1.0];
  [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:flipContainer cache:YES];
  [UIView setAnimationDuration:1.0];
  CGAffineTransform transform = CGAffineTransformMakeScale(1, 1);
  flipContainer.transform = transform;
  [UIView commitAnimations];
  [flipContainer addSubview:backSide];
}
+14

, - , . , turnUp flipContainer ( ), .

// construct animation container
self.flipContainer = [[FlipContainer alloc] init];
[self.flipContainer.view setFrame:CGRectMake(clickedSquareX, clickedSquareY, 200, 200)];
[self.flipContainer.view addSubview:self.backside.view];
// add animation container
[self.myParentView.view addSubview:self.flipContainer.view];
// PROCEED to your turnUp code

, , - UIScrollView, "" 200x200 , , flipContainer , . , ? - turnUp:

[backSide removeFromSuperview];

.., .

, - , !

0

All Articles