2014-07-06 46 views
1

我是新來的核心圖形,我想在這個動畫完成後使用CGAffineTransformScale顯示從右到左的動畫我已經將縮放動畫應用到相同的視圖。如何添加從左到右的動畫和使用CGAffineTransformScale縮放動畫

我可以顯示從左到右的動畫。但我無法顯示縮放動畫。

有人可以幫助我解決上述問題。

請找到下面的代碼我試過。

toView.layer.anchorPoint = CGPointMake(1, 0.5); 
toView.center = CGPointMake(toViewController.view.bounds.size.width,toViewController.view.bounds.size.height/2.0); 
toView.transform = CGAffineTransformScale(CGAffineTransformIdentity, -1.0, 1.0); 
[UIView animateWithDuration:ANIMATION_DURATION delay: 0.0 options: UIViewAnimationOptionTransitionFlipFromLeft animations:^{ 
      [toView setTransform: CGAffineTransformMakeScale(1.0, 1.0)]; 

     } completion:^(BOOL finished) { 

     }]; 

回答

0

你的刻度值1.0是默認值,將其更改爲比1.0以外的任何其他值,可能是1.2以放大或0.8縮小。

我認爲應該爲你的動畫塊增加一些內容。

[UIView animateWithDuration:ANIMATION_DURATION delay: 0.0 options: UIViewAnimationOptionTransitionFlipFromLeft animations:^{ 
      [toView setTransform: CGAffineTransformMakeScale(1.2, 1.2)]; //Zoom in 

} completion:^(BOOL finished) { 
     if(finished){ 
     [UIView animateWithDuration:ANIMATION_DURATION animations:^{ 
       toView.transform=CGAffineTransformIdentity; //Make things normal. 
     }]; 
     } 
}]; 

我希望它有效。

乾杯。