2012-01-05 57 views
1

我有一個滾動視圖,它有一堆照片縮略圖就像在照片應用程序/圖像選擇器。當我旋轉它時,我想更新旋轉動畫中間的滾動視圖(在willAnimateRotationToInterfaceOrientation中),但我只是希望它在沒有動畫的情況下進行更新(不要讓縮略圖在移動到新位置時進行動畫製作) 。我怎樣才能做到這一點?我正在使用setCenter在發生旋轉時移動縮略圖。我已經嘗試了所有其他旋轉方法,但是他們沒有完成這項工作,因爲我需要在旋轉動畫發生時進行更新,因爲這是最好的。在willAnimateRotationToInterfaceOrientation中禁用動畫?

回答

4

使用在willAnimateRotationToInterfaceOrientation方法以下工作:

[UIView setAnimationsEnabled:NO]; 
//insert what you want to not be animated here 
[UIView setAnimationsEnabled:YES];