WebView html with images fixed

This commit is contained in:
Vladimir Enchev
2015-10-22 11:11:15 +03:00
parent 9c0ac9e471
commit 0f2c57fb45
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,6 @@
<Page>
<GridLayout>
<WebView src="&lt;html&gt;&lt;body&gt;&lt;img src='./tests/logo.png'&gt;&lt;/img&gt;&lt;/body&gt;&lt;/html&gt;" />
</GridLayout>
</Page>

View File

@ -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 {