Why does scrolling a UIWebView *feel* so much different than scrolling any other UIScrollView? Why does scrolling a UIWebView *feel* so much different than scrolling any other UIScrollView? ios ios

Why does scrolling a UIWebView *feel* so much different than scrolling any other UIScrollView?


I have the same perception. It must have to do with the webView's scrollView deceleration rate. Just ran this test, and 1) it confirms our suspicion and 2) suggests a fix.

I added a scrollView and a webView to my UI then logged the following:

NSLog(@"my scroll view's decel rate is %f", self.scrollView.decelerationRate);NSLog(@"my web view's decel rate is %f", self.webView.scrollView.decelerationRate);NSLog(@"normal is %f, fast is %f", UIScrollViewDecelerationRateNormal, UIScrollViewDecelerationRateFast);

The output confirms the guess about webView being more frictional:

my scroll view's decel rate is 0.998000my web view's decel rate is 0.989324normal is 0.998000, fast is 0.990000

And suggests a fix:

self.webView.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal;


matomo