From 0f2c57fb45758844415c7b458b8f74b9ef528e1c Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Thu, 22 Oct 2015 11:11:15 +0300 Subject: [PATCH] WebView html with images fixed --- apps/ui-tests-app/web-view/webviewhtmlwithimages.xml | 6 ++++++ ui/web-view/web-view.android.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 apps/ui-tests-app/web-view/webviewhtmlwithimages.xml diff --git a/apps/ui-tests-app/web-view/webviewhtmlwithimages.xml b/apps/ui-tests-app/web-view/webviewhtmlwithimages.xml new file mode 100644 index 0000000000..8f99b7cbec --- /dev/null +++ b/apps/ui-tests-app/web-view/webviewhtmlwithimages.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/ui/web-view/web-view.android.ts b/ui/web-view/web-view.android.ts index 89087fe5d6..d6033f32e2 100644 --- a/ui/web-view/web-view.android.ts +++ b/ui/web-view/web-view.android.ts @@ -1,5 +1,6 @@ import common = require("./web-view-common"); import trace = require("trace"); +import fs = require("file-system"); global.moduleMerge(common, exports); @@ -99,7 +100,8 @@ export class WebView extends common.WebView { return; } - this._android.loadData(src, "text/html; charset=utf-8", "utf-8"); + var baseUrl = `file:///${fs.knownFolders.currentApp().path}/`; + this._android.loadDataWithBaseURL(baseUrl, src, "text/html; charset=utf-8", "utf-8", null); } get canGoBack(): boolean {