leC*_*Con 4 iphone scroll uiscrollview vertical-scrolling
有没有办法降低UIScrollView中的滚动速度,我试图用它 scrollRectToVisible: animated: NO来完成这个(通过将动画设置为NO),但似乎这不是正确的方法.
您可以使用简单的uiview动画来做到这一点..
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2];
[scrollview scrollRectToVisible:rect animated:NO];
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)
这是我所知道的唯一方式.
ios 4方式(这在仍然运行3.x的iphone上不起作用):
[UIView animateWithDuration:2 animations:^(void){
[scrollview scrollRectToVisible:rect animated:NO];
}];
Run Code Online (Sandbox Code Playgroud)
我知道这不是你要求的,但它可以帮助你设置UIScrollView属性的减速率
@property(nonatomic) float decelerationRate
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13793 次 |
| 最近记录: |