Dear all,
I submit to you a simple code that supposedly loads a local HTML, and I don’t know why, I cannot make the HTML to see the css or images. My project has a simple tree (images are shared between HTML and my app): I have images in PRJROOT/images, and in PRJROOT/html I have my HTML. My code is very basic:
print("\> native webview html " .. params.html) local webView = native.newWebView(platform.left() + pad, platform.top() + pad / 2, platform.width() - pad \* 2, platform.height() - pad / 2) webView:request(params.html, system.ResourceDirectory) webView.hasBackground = false
The output is as I imagine:
2014-05-23 12:19:42.524 Corona Simulator[5223:507] \> native webview html html/index.html
The web view is visible, the text is visible, but the HTML won’t see the CSS or any images. I’ve tried many combinations for the location and url of my images and css, but I haven’t found a solution yet.
\<html\> \<head\> \<link rel="stylesheet" type="text/css" href="/style.css"\> \</head\> \<body\> \<div id="logo"\> \<img src="/images/logo.jpg" alt="Logo" /\> \</div\> \<div id="intro"\> \<p\> Lorem ipsum dolorem. \</p\> \</div\> \</body\> \</html\>
I know this is quite a stupid code, but I cannot spot my error.
Can you help me?
Thanks!