I have a window in a tab,and there is webview in it.The strange thing is when usewebview.html and the htmlcode has the tag p.If you go to next window and back,the webview's height will grow longer and longer.But if the webview has no p tag,the code runs normaly.Here is the code:
var win = Ti.UI.currentWindow; var embedCode = '<html><head></head><body>' +'<p>Test Test</p>'+ '</body></html>'; var webview = Ti.UI.createWebView({ backgroundColor: 'red', top:150, left:50, right: 50, height: 'auto', html:embedCode, }) win.add(webview); var button = Ti.UI.createButton({ top:300, left:50, title:"Test", }); win.add(button); button.addEventListener('click',function(){ var win = Ti.UI.createWindow({ url:'/pages/test/test.js', backgroundColor:'black', navBarHidden:false, }); Ti.UI.currentTab.open(win); })Some one help me!
2 Answers
You have to modify the META infos in HTML header.
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> <meta name="apple-mobile-web-app-capable" content="yes">Hope this helps.
Rainer
anyone help?
Your Answer
Think you can help? Login to answer this question!