刷新UIWebView [英] Refresh a UIWebView

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

问题描述

我正在寻找一种向UIWebView添加刷新机制的简单方法。我已经看过关于EGO拉动刷新的帖子,但说实话,我不明白它是如何工作的,特别是因为我不知道如何使用UIWebView而不是表视图。在我看来,只需要一个简单的刷新就可以获得很多开销。

I'm looking for a simple way of adding a refresh mechanism to my UIWebView. I've seen posts about the EGO pull to refresh but, to be honest, I don't understand how that works, especially since I have no clue on how to use it with a UIWebView instead of a table view. And it seems to me like a lot of overhead for just a simple refresh.

我考虑添加导航栏而不是后退按钮,添加自定义刷新按钮。但根据我到目前为止发现的情况,它似乎与其他解决方案一样复杂。

I thought about adding a navbar but instead of a back button, add a custom "refresh" one. But based on what I've found so far, it seems as complicated as the other solution.

所以,基本上,我想知道你会做什么。请记住,唯一的要求是用户可以轻松地刷新视图。有什么建议吗?

So, basically, I'd like to know what you would do. Keep in mind that the only requirement is that the user have some easy way of refreshing the view. Any suggestion ?

*我是Objective-C的初学者,这就是为什么我不明白如何在下载和运行代码后用UIWebView插入EGO框架。

*I'm a begginer in Objective-C so that is why I don't understand how to plug the EGO framework with a UIWebView even after downloading and running the code.

推荐答案

好吧,

创建一个按钮和内部按钮的IBAction ,

Create a button and inside button's IBAction,

- (IBAction) performReload:(id) sender {
    [self.uiwebview reload];
}

查看文档,它会在您开始阶段为您提供很多帮助。

Check the documentation, it will help you a lot at your beginning stage.


http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html

这篇关于刷新UIWebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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