2011-12-28 34 views
0

子類化UIPickerView和覆蓋-scrollAnimationDuration允許更改iOS 5之前的選擇器視圖的動畫持續時間。有誰知道另一個設置iOS 5中選擇器視圖的動畫持續時間的技巧嗎?如何設置UIPickerView的動畫持續時間?

這工作前的iOS 5:

// Subclass of UIPickerView 
@implementation SpinDurationView 

- (double)scrollAnimationDuration { return 2.7; } 

@end 

回答

0

你試過嗎?

CGPoint newLogoutCenter = CGPointMake(160, 364); 
    [UIView beginAnimations:nil context:nil]; 
    [UIView setAnimationDuration:1.0f]; 
    pickerview.center = newLogoutCenter; 
    [UIView commitAnimations]; 

我使用這個動畫代碼爲UIButton。 UILable等。我從來沒有用過UIPickerView。但你可以試試。

+0

我將它添加到pickerview的子類而不是上面的行嗎? – Skovie 2012-01-04 21:22:29

+0

你可以試試,我從來沒有嘗試過。 – AAV 2012-01-04 21:29:47

+0

有沒有人得到這個工作? – mea36 2012-02-01 15:30:33