Mos*_*she 5 iphone animation objective-c uiscrollview subclassing
有没有办法在滚动UIScrollView时更改scrollRectToVisible动画的速度?
Cam*_*oft 13
只需将animation参数设置为NO,然后使用UIView的动画类方法执行自己的动画.
[UIView animateWithDuration:1.0f delay:0.0f options:UIViewAnimationOptionCurveEaseOut animations:^{
[scrollView scrollRectToVisible:viewFrame animated:NO];
} completion:nil];
Run Code Online (Sandbox Code Playgroud)
不,不是公共方法.持续时间固定为0.3秒.
这里是一个私人的,未公开的API来改变时间:
@interface UIScrollView(UIScrollViewInternal)
-(void)_setContentOffsetAnimationDuration:(NSTimeInterval)duration;
@end
Run Code Online (Sandbox Code Playgroud)
但作为所有未记录的API,使用此将导致AppStore拒绝.
| 归档时间: |
|
| 查看次数: |
2467 次 |
| 最近记录: |