Open iShawnWang opened 6 years ago
我之前也猜想过是runloop的原因 还没找到解决方案 下面的代码暂时解决setTimeOut的问题
var now = new Date();
var exitTime = now.getTime() + number;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
break;
}
我试试上面native注入setTimeOut的方式
我自己尝试 Google 过, 全是讲 WKWebView 的 API 相关的东西, 暂时还没什么头绪...
提交了一个PR,https://github.com/weidian-inc/hera/pull/40 不知有没有帮助。
谢谢大佬,这个很有帮助,ios下setTimeout 失灵的问题之前一直没解决。
On Fri, Aug 24, 2018 at 19:06 gordanyang notifications@github.com wrote:
提交了一个PR,#40 https://github.com/weidian-inc/hera/pull/40 不知有没有帮助。
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/weidian-inc/hera/issues/19#issuecomment-415727494, or mute the thread https://github.com/notifications/unsubscribe-auth/AHwpsH8OoqZfWDOjN5xZ4Xp2UiyMnn3oks5uT946gaJpZM4RH3aa .
发现的问题
我的猜想和推理
相关的情况
Inspect 界面出来后, 菊花会一直转, 此时你手动点击按钮或者 push 新界面, 这个菊花就停止转了, 一切正常了, (我的情况是 : 主页面有轮播图, 轮播图自动轮播事件触发后, 一切正常了)
具体情况可以联系 @me & @IOriens
Update
找到了暂时的 polyfill : native 注入 setTimeOut 方法, 用 dispatch_after 实现