加入收藏 | 设为首页 | 会员中心 | 我要投稿 PHP编程网 - 黄冈站长网 (http://www.0713zz.com/)- 数据应用、建站、人体识别、智能机器人、语音技术!
当前位置: 首页 > 教程 > 正文

UIWebView中显示本地图片的技巧

发布时间:2021-12-14 21:40:19 所属栏目:教程 来源:互联网
导读:UIWebView中显示本地图片的方法: html内容如下: html Opening Hours:br/ Monday to Friday 7am and 7pmbr/ Saturday from 8am until 12noonbr/br/ Northcross Physiotherapy and Rehabilitation is a Physiotherapy Private Practice situated in the North
UIWebView中显示本地图片的方法:
 
html内容如下:
 
<html>  
    Opening Hours:<br/>  
    Monday to Friday 7am and 7pm<br/>  
    Saturday from 8am until 12noon<br/><br/>  
    Northcross Physiotherapy and Rehabilitation is a Physiotherapy Private Practice situated in the Northcross Specialist Centre. This is a private company established by it's current principle. The practice's primary activity involves the provision of specialist physiotherapy services and education to the local population. This has been in operation at the current site since June 1997 and at premises closer to the Albany Village since 1991. As well as this website, Northcross Physiotherapy also has a Trade Me listing.<br/>  
    <img src="about.png" width="320" height="241"/>  
</html>
about.png和html文件在同一个目录下。
 
示例:
 
NSString *path = [[NSBundle mainBundle] bundlePath];   
NSURL *baseURL = [NSURL fileURLWithPath:path];   
NSString *htmlString = [NSString stringWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"about" ofType:@"html"]  encoding:NSUTF8StringEncoding error:nil];   
[self.webView loadHTMLString:htmlString baseURL:baseURL]; 

(编辑:PHP编程网 - 黄冈站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读