如何重新加载或刷新 web 视图 [英] How do I reload or refresh a webview
问题描述
... 在 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屋!