2012-07-02 18 views
0

我檢查了其他幾篇文章,發現了一些UIAnimation轉換,可以爲iPad上的iTunes應用程序提供翻轉+縮放轉換的解決方案。但是,我並沒有得到完全相同的結果。我試過循環UIView動畫,但不起作用。在iPad上翻轉+比例轉換就像iTunes一樣

有人可以對此有所瞭解嗎?

回答

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轉換結束後顯示的視圖。希望能幫助任何希望實現這個目標的人:)