mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
web-view images now will be loaded correctly with base url
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<Page>
|
||||
<StackLayout orientation="vertical">
|
||||
<WebView src="~/web-view/test.html" height="50" />
|
||||
<WebView src="<html><body><img src='./pages/test2.png'></img></body></html>" height="75" />
|
||||
<WebView src="<html><body><img src='./ui-tests-app/pages/test2.png'></img></body></html>" height="75" />
|
||||
</StackLayout>
|
||||
</Page>
|
||||
|
@ -1,5 +1,6 @@
|
||||
import common = require("./web-view-common");
|
||||
import trace = require("trace");
|
||||
import fs = require("file-system");
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
|
||||
@ -99,8 +100,8 @@ export class WebView extends common.WebView {
|
||||
this._ios.loadRequest(NSURLRequest.requestWithURL(NSURL.URLWithString(src)));
|
||||
}
|
||||
|
||||
public _loadData(src: string) {
|
||||
this._ios.loadHTMLStringBaseURL(src, null);
|
||||
public _loadData(content: string) {
|
||||
this._ios.loadHTMLStringBaseURL(content, NSURL.alloc().initWithString(`file:///${fs.knownFolders.currentApp().path}/`));
|
||||
}
|
||||
|
||||
get canGoBack(): boolean {
|
||||
|
Reference in New Issue
Block a user