如何重新加载或刷新 web 视图 [英] How do I reload or refresh a webview

查看:52
本文介绍了如何重新加载或刷新 web 视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

... 在 uiwebview 之外有一个按钮?请参阅附上的截图.

... with a button outside of the uiwebview? please see screenshot attached.

问题是,我在 webview 中有一个本地 html 站点,它可以访问更多本地网站.我希望用户能够通过点击顶部的主页"按钮返回本地网站的主页",这不是 uiwebview 的一部分.

the thing is, that I have a local html site in the webview, that goes to further local web sites. I want the user to be able to get back to the "home page" of the local website by clicking on the "home" button on the top, which is not part of the uiwebview.

(我的 xcode 状态是初学者.)

(my xcode status is beginner.)

感谢您的帮助.

推荐答案

您可以通过调用 UIWebView 类下的 loadRequest 方法刷新 webview.

You can refresh the webview by calling loadRequest method under the UIWebView class.

[webView loadRequest:[NSURLRequest requestWithURL:theURL]];

您必须在theURL 中传递您的网址.因此,您将获得刷新后的页面.

You have to pass your url in theURL. So, you will get the refreshed page.

这篇关于如何重新加载或刷新 web 视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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