---
title: "WebView中loadDataWithBaseURL与loadData加载本地html困惑"
author: "wanggp"
date: "2011-07-22T19:03:01Z"
tags: []
categories: ["移动开发"]
slug: "webview-loaddatawithbaseurl-loaddata-html"
draft: false
lastmod: "2011-07-22T19:03:33Z"
id: 1130972
url: "https://wanggp.iteye.com/blog/1130972"
---

当使用webView.loadData(bodyBuffer.toString(), "text/html", "utf-8")加载本地的html代码时，如果html代码中%，则页面不能显示，显示为web page not availableness.而使用webView.loadDataWithBaseURL("about:blank",bodyBuffer.toString(), "text/html", "utf-8",null);即可正常加载，不知道为什么？期待找到正解。