像翻转iPad上的iTunes +等级变化(Flip+Scale Transition like i

2019-09-18 23:03发布

我已经检查了其他几个帖子,发现了一些UIAnimation过渡样,那给予解决做就像在iPad上的iTunes应用程序的翻盖+规模化。 但是,我没有得到完全相同的结果。 我曾尝试循环UIView的动画,但不起作用。

有人可以提供一些线索这光?

Answer 1:

所以我一直在做这个,我终于找到了解决办法:)

[UIView animateWithDuration:0.4 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:
 ^{
     rect = placeHolderView.frame;

     rect.origin.x += 100;
     rect.origin.y += 70;

     [UIView beginAnimations:nil context:NULL];
     [UIView setAnimationDuration:0.5];
      placeHolderView.frame = rect;
     [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:placeHolderView cache:YES];
     [UIView setAnimationDuration:0.5];
     CGAffineTransform transform = CGAffineTransformMakeScale(3.0, 3.0);
     placeHolderView.transform = transform;

     [UIView commitAnimations];

     self.view.layer.cornerRadius = 5.0f;
     self.view.clipsToBounds = YES;

 } completion:^(BOOL finished) {

         [UIView setAnimationBeginsFromCurrentState:YES];
         [UIView transitionWithView:placeHolderView duration:0.8 options:UIViewAnimationOptionTransitionFlipFromRight|UIViewAnimationOptionBeginFromCurrentState animations:
          ^{
              CGAffineTransform transform = CGAffineTransformMakeScale(10.0, 10.0);
              placeHolderView.transform = transform;
              [UIView beginAnimations:nil context:NULL];
              [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.purchaseItemView cache:YES];
              [placeHolderView setAlpha:0.0];
              [self.myMainView setAlpha:1.0];
              [UIView setAnimationDuration:0.8];
              [UIView commitAnimations];



          } completion:nil];

 }
 ];

的placeholderView是将从一个小16x6图像进行缩放的视图。 而myMainView是倒装+等级转变后示出的视图是结束了。 希望可以帮助任何人都希望实现这个:)



文章来源: Flip+Scale Transition like iTunes on iPad
标签: iphone uiview