继承UIPickerView和重写-scrollAnimationDuration允许在iOS 5之前更改选择器视图的动画持续时间。有谁知道在iOS 5中设置选择器视图的动画持续时间的另一个诀窍吗?
这适用于iOS 5之前的版本:
// Subclass of UIPickerView
@implementation SpinDurationView
- (double)scrollAnimationDuration { return 2.7; }
@end发布于 2011-12-29 04:33:46
你试过这个吗?
CGPoint newLogoutCenter = CGPointMake(160, 364);
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0f];
pickerview.center = newLogoutCenter;
[UIView commitAnimations];我在UIButton中使用了这个动画代码。UILable等。我从来没有用过UIPickerView。但你可以试试。
https://stackoverflow.com/questions/8660605
复制相似问题