2011-04-01 60 views

回答

5

你正在尋找的是knwn爲Ken Burns效果平移

這裏是應用它的代碼..什麼

 [UIView beginAnimations:nil context:NULL]; 
     [UIView setAnimationDuration:7]; 

     [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; 
     CGAffineTransform rotate = CGAffineTransformMakeRotation(0.00); 
     CGAffineTransform moveLeft = CGAffineTransformMakeTranslation(0.9,0.9); 
     CGAffineTransform combo1 = CGAffineTransformConcat(rotate, moveLeft); 

     CGAffineTransform zoomOut = CGAffineTransformMakeScale(1.1,1.1); 
     CGAffineTransform transform = CGAffineTransformConcat(zoomOut, combo1); 
     background.transform = transform; 
     [UIView commitAnimations]; 

快樂編碼:)

+0

嗨Shrey,你有任何示例代碼? – avinash 2011-04-01 12:34:12

+0

上面的代碼工程花花公子..我用它。 – Hisenberg 2011-04-01 12:38:16

+0

我有4個圖像,它適用於第一張圖片。但不會對其他圖像產生相同的效果。 – avinash 2011-04-01 12:46:27