如何判断webview页面被加载?
问题描述:
判断webview页面是如何加载的?让我告诉你该页面正在加载。 此外,无法打开Webview中加载的网页,如下面的一些URL。如何判断webview页面被加载?
- (void)awakeFromNib {
NSString *urlString = @"http://www.google.com";
// Insert code here to initialize your application
[[_webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]];
}
- (IBAction)googleOpen:(id)sender {
[_webView setMainFrameURL:@"http://www.google.com"];
}
- (IBAction)baiduOpen:(id)sender {
[_webView setMainFrameURL:@"http://www.baidu.com"];
}
- (IBAction)yahooOpen:(id)sender {
[_webView setMainFrameURL:@"http://www.yahoo.com"];
}
如何以传递参数的方式打开URL?
答
如果你想知道一个网站的加载,链接WebFrameLoadDelegate协议,并实现
webView:didFinishLoadForFrame:
知道,如果网页加载。使用
webView:didStartProvisionalLoadForFrame:
来知道网页是否已经开始加载。检查您与互联网的连接,看看您是否可以从其他网络浏览器打开网站。如果有效,请检查您的IBAction是否与您的按钮正确链接。
你打开一个带有参数的URL是什么意思?如果您的意思是让一个文本字段允许用户在某些网站(如Google)上搜索关键字,则只需执行
http://www.google.com/search?q=%yoursearch
,用用户输入替换%yoursearch。
我想在web view中打开链接地址,并设置窗口大小。设置链接地址打开窗口大小就好。 – 2012-04-22 06:57:53