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];
分享到:
相关推荐
在UIWebView中加载本地图片,http://blog.csdn.net/zhangao0086/article/details/7262192
详情请参考http://blog.csdn.net/hursing/article/details/12868109
IOS开发中因为引入cocos2dx,导致代码审核不通过无法提交( Apple will stop accepting submissions of apps that use UIWebView APIs )。该问题的解决方案有两种:1)升级Cocos2dx的版本,在查看Cocoas官网及Cocoas...
因此,实现用户触击UIWebView页面中的链接,并跳至Safari中打开链接页面的步骤如下: 定义实现UIWebViewDelegate协议的类MyWebViewDelegate(通常是由包含UIWebView的controller中实现UIWebViewDelegate协议)。 ...
UIWebView+html+css,实现UIWebView中可点击链接,并且可显示gif动画效果
uiwebview的使用方法。从怎么建立uiwebview讲起,详细讲述了此控件的使用方法
uiwebview加载各种本地文件(通过loadData方法): UIWebView加载内容的三种方式: 1 加载本地数据文件 指定文件的MIMEType 编码格式使用@“UTF-8” 2加载html字符串(可以加载全部或者部分html文件) 3加载...
iOS UIWebView URL拦截.pdf
UIWebview使用中的js交互简单的简析 欢迎大家指点 共同学习
这是我在学习ios的过程中写的一个demo,使用UIWebView实现一个简单的浏览器
UIWebView和js交互 里边自己写了个H5方便大家理解
NSURLCache让本地数据来代替远程UIWebView请求
UIWebView Web 网页 Demo 代码
UIWebView与JS交互小例子,其中涉及APP向JS提交信息,和JS提交信息给App
使用UIWebView和JS进行交互,可以OC操作js,也可以JS对OC进行交互
网页视图的基本使用,网络资源地址字符串的处理,UIWebView属性与协议的综合使用;
一款UIWebView的加载进度条,基于CAShapeLayer,有两种显示风格:纯颜色显示和渐变色显示
UIWebView实现图文混排