无法在iOS 9 beta / 9.3上更改WKWebView的滚动速率 [英] Cannot change WKWebView's scroll rate on iOS 9 beta / 9.3

查看:382
本文介绍了无法在iOS 9 beta / 9.3上更改WKWebView的滚动速率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS 8上,下面的代码工作正常,它可以更惯性地滚动。

On iOS 8, the below code works fine, it can scroll with more inertia.

webView.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal;

对于iOS 9 beta 3,即使没有错误,此代码也毫无意义。

这是一个错误还是还有其他方法吗?

As for iOS 9 beta 3, this code is meaningless, even without an error.
Is this a bug or are there any other ways around?

注意:UIWebView的滚动速率可以在两个版本上更改两种类型。

Note: UIWebView's scroll rate can be changed two types on both versions.

推荐答案

更新:这已经修复但未在iOS 9.3中部署(请参阅下面的解决方法)。更多细节:

Update: this has been fixed but not deployed in iOS 9.3 (see workaround below). More detail here:

  • https://bugs.webkit.org/show_bug.cgi?id=148086
  • http://trac.webkit.org/changeset/188541/trunk/Source/WebKit2/UIProcess/ios/WKScrollView.mm

我有同样的问题,似乎是iOS 9中的一个错误。

I had the same issue and it seems to be a bug in iOS 9.

解决方法是在将开始拖动委托而不是在实例化时设置它:

The workaround is to set it in the will begin dragging delegate instead of at the time of instantiation:

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
    scrollView.decelerationRate = UIScrollViewDecelerationRateNormal;
}

这篇关于无法在iOS 9 beta / 9.3上更改WKWebView的滚动速率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆