所以,我在UIWebView
. 理想情况下,用户可以选择用手指或点击按钮滚动浏览它。就像当他们点击按钮时,它会向下滚动一英寸左右。这是我正在使用的代码(感谢 danypata):
//Scroll Up:
-(IBAction)scrollContentUp:(id)sender {
[_viewWeb.scrollView setContentOffset:_viewWeb.scrollView.contentOffset.y - 10.0 animated:YES];
}
//Scroll down:
-(IBAction)scrollContentDown:(id)sender {
[_viewWeb.scrollView setContentOffset:_viewWeb.scrollView.contentOffset.y + 10.0 animated:YES];
}
问题在于 10.0。我收到错误:
Sending double to parameter of incompatible type CGPoint (aka struct CGPoint)
我以前从未使用过 CGPoints,并尝试过研究它们,但它超出了我的想象。有谁知道在这段代码中插入什么来实现滚动效果?