iOS开发UI篇 -- UIWebView

来源:互联网 发布:c语言中eof怎么用 编辑:程序博客网 时间:2024/05/18 03:08


加载网页

// 创建URL
 NSURL *url = [[NSBundle mainBundle] URLForResource:@”abc.html” withExtension:nil];
// 创建请求
NSURLRequest *request = [NSURLRequest requestWithURL:url];  
// 发送请求加载网页
[webView loadRequest:request];

执行JavaScript(要等网页加载完毕才能执行)
[webView stringByEvaluatingJavaScriptFromString:js];

监听webView的加载
设置代理监听:webView.delegate = self;

0 0
原创粉丝点击