您的位置:首页 > 移动开发

webview加载gif图片

2016-12-13 15:30 701 查看
下面是index.htmlx界面代码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<nav title="webview和html互相调用"></nav>

<webview id="webview" width="100%" height="100%" url="local://html/my.htm" />
</body>
<script>

//webview调用html里面的方法
webview.addEvent("onFinished" , function(){
webview.execute("changeLabelValue()");
})

webview.addEvent("onFailured" , function(){

})

function click1(data){
//html传过来的中文会出现乱码,所以使用解码方法进行解码
var string = decodeURIComponent(data);
alert(string)
}

</script>
</html>

点击可以下载gifDemo.zip示例demo
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: