iPhone开发之webview 拖动和显示本地图片的几组代码

NSString *file = [[NSBundle mainBundle] pathForResource:@”7,0″ ofType:@”png”];

NSString *url = [NSString stringWithFormat:@"

<html>

<head>

<script type=\"text/javascript\">document.ontouchmove = function(e){ e.preventDefault();} </script>

</head>

<style>a,a:link,a:visited,a:hover,a:active {text-decoration:none;color:blue;}</style>

<body>

<a href='http://www.minroad.com/'>linklinklink</a>

<img src='file://%@'>

</body>

</html>",file];

[webview loadHTMLString:url baseURL:nil];

posted @ 2011-08-31 15:42  老码农豆豆  阅读(658)  评论(0编辑  收藏  举报