发布网友 发布时间:2022-04-23 08:59
共1个回答
热心网友 时间:2022-04-21 09:36
代码例子:NSURL *url = [NSURL URLWithString:@" http://google.com"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView loadRequest:request]; NSString *HTMLData = @"Hello this is a test"; [webView loadHTMLString:HTMLData baseURL:nil];NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"html"];NSData *htmlData = [NSData dataWithContentsOfFile:htmlFile];[webView loadData:htmlData MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString:@""]]; 到DEVDIV.COM网站查看回答详情>>