我有这个scrollView: self.scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];self.scrollView.autoresizingMask = UIViewAutoresizingFlexibleHeight;self.scrollView.contentSize = CGSizeMake(320,3000);_scrollView.frame = CGR
self.scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds]; self.scrollView.autoresizingMask = UIViewAutoresizingFlexibleHeight; self.scrollView.contentSize = CGSizeMake(320,3000); _scrollView.frame = CGRectMake(0, 45, 320, 420);
我想让它自动滚动到非常缓慢,直到最后,以便用户可以看到内容(如电影信用),最终有一个停止/播放按钮,但在触摸界面时按照用户手势.
我怎样才能做到这一点?
谢谢,
[_scrollView setContentOffset:CGPointMake(x,y) animated:YES];
并使用x和y作为您可以捕获的屏幕上的触摸点.
您还可以使用CoreAnimation进行动画制作:
[UIScrollView beginAnimations:@"scrollAnimation" context:nil]; [UIScrollView setAnimationDuration:1.0f]; [scroll setContentOffset:CGPointMake(x, y)]; [UIScrollView commitAnimations];