Webview <p> BUG on IOS (Titanium SDK 1.8.0.1,1.8.1,1.8.2)!Some one Help!

You must Login before you can answer or comment on any questions.

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!

— asked 1 year ago by yu wenbin
1 Comment
  • I must use height:'auto'because I don't konw the exactly height of the webview(I get data from http),hope someone can help me

    — commented 1 year ago by yu wenbin

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

— answered 1 year ago by Rainer Schleevoigt
answer permalink
1 Comment
  • I'm sorry about that the code doesn't help any more?but still thank you for your help...Can anyone else help me?

    — commented 1 year ago by yu wenbin

Your Answer

Think you can help? Login to answer this question!