2012-05-14 68 views
1

我有一些代碼,導致UIImageView旋轉180度時,用戶觸摸圖像。不幸的是,當用戶再次觸摸它時,什麼也沒有發生。我假設已經確定圖像已經旋轉180度,這可能是它不再移動的原因。我如何解決這個問題,謝謝。只能旋轉UIImageView一次

-(void) spinSun 
{ 
    [UIView animateWithDuration:2.0f animations:^{ 
     imgSun.transform = CGAffineTransformMakeRotation(-3.142); 
    } completion:^(BOOL finished) { 

    }]; 
} 
+0

imgSun.transform = CGAffineTransformRotate(imgSun.transform,-3.142); –

回答

5

你必須創建一個新的變換矩陣:

imgSun.transform = CGAffineTransformRotate(imgSun.transform, -3.142)