缩放和捏合后 Uiwebview 刷新

发布于 2024-09-04 04:09:54 字数 158 浏览 4 评论 0原文

我的应用程序中有一个 uiwebview 。到目前为止,一切正常,但是当我放大或缩小时,例如 uiwebview 会刷新加载的页面,然后滚动并缩放到新的页面位置和大小。所以缩放效果很好,但我不希望用户看到网站的刷新和重新定位。

有办法防止这种情况吗?

感谢您的任何提示!

I have a uiwebview in my App. So far everything works fine, but when i zoom in or out for example the uiwebview refreshes the loaded page and then scrolls and zooms to the new page location and size. So the zooming works good, but I don't want the user to see the refresh and repositioning of the website.

Is there a way to prevent this?

Thanks for any tips!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

追星践月 2024-09-11 04:09:54

这可能是因为您可能以奇怪的方式编码了缩放。您可以尝试删除所有缩放代码,并在使用 webView loadRequest 的相同方法中键入:

self.webView.scalesPageToFit = YES

希望这会有所帮助。

This could be because you might have coded your zoom in an odd way. You could try deleting all your zoom code, and in the same method where you have your webView loadRequest, type:

self.webView.scalesPageToFit = YES

Hope this helps.

高跟鞋的旋律 2024-09-11 04:09:54

您应该动态刷新页面,而不是通过 webview 刷新。您可以通过使用 AJAX 或检索 Objective C 中的内容并使用 stringByEvaluatingJavaScriptFromString: 注入它来完成此操作。

You should refresh your page dynamically, instead of refreshing it through the webview. You can accomplish this by using AJAX or retrieving the content in Objective C and injecting it using stringByEvaluatingJavaScriptFromString:.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文