I'm using Appcelerator Titanium to develop a mobile app. When I tried to create a WebView to open a local html file with iframe, it opened the html file inside the iframe instead. The parent html was replaced. When I wrapped one more iframe in the second html file, only the innermost html was opened.
The problem only happens in Android. It doesn't happen in iOS. And if the html is on the internet, then it will display correctly. And only local html has this behaviour.
Is it an Android problem or is it Appcelerator's bug? Can it be solved? Thanks in advance.
Here are my sample code:
app.js
var self = Ti.UI.createWindow({});
var url="index.html";
var webview=Ti.UI.createWebView({
url:url,
width:Ti.UI.FILL,
height:Ti.UI.FILL
});
self.add(webview);
index.html
<body style="background:red"> Page 1<br>
<iframe style="width:200px;height:150px;border:solid 3px blue" src="index2.html"></iframe>
</body>
index2.html
<body style="background-color:yellow">
Page 2
</body>
Result in iOS & Android - https://imgur.com/a/XUiFGrI