title: Appcelerator: Webview on iPhone with an iFrame and width
body: <p>Good evening,</p>
  
  <p>I've been having some issues with a view that has a webview inside. The webview is inserting an iframe with an external source (an html on another domain). I'm using an iframe since I need to use the external HTML and I need to communicate with click/touch events with my application.</p>
  
  <p>The main issue is that the webview is inserting unwanted horizontal scroll bars (because the iframe content is too big)</p>
  
  <p>The code looks like:</p>
  
  <p><strong>Webview:</strong></p>
  
  <pre><code>var webview = Titanium.UI.createWebView({
      url: "/html/local.html",
      width:Ti.UI.SIZE,
      height:Ti.UI.SIZE,
      contentWidth:Ti.UI.SIZE,
      contentHeight:Ti.UI.SIZE,
      disableBounce:true,
      enableZoomControls: false
  });
  self.add(webview);
  </code></pre>
  
  <p><strong>iframe:</strong></p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/&gt;
          &lt;meta http-equiv="cleartype" content="on"&gt;
          &lt;script&gt;
              function init () {
                  window.theIframe.TiAPI = Ti.API;
                  window.theIframe.TiApp = Ti.App;
              }
          &lt;/script&gt;               
          &lt;style&gt;
              body {width:100%;margin:0;padding:0;background-color:#ccffff;}
          &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;iframe name="theIframe" src="http://external.com/something.html" width="100%" height="100%" frameborder="0" onload="init()"&gt;
          &lt;/iframe&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Things to notice:</strong></p>
  
  <ul>
  <li>This only happens on portrait. It works fine on the iPad or on the iPhone with landscape view.</li>
  <li>If, under the external html, I set the max-width for the body to 320px it works perfectly. I won't make it this way because I need it to work under landscape and iPad.</li>
  <li>If I use the external html as the URL for the webview, it works too. So it's not an issue with the external content, but with the local html or the webview and the iframe.</li>
  </ul>
  
  <p>Any thought?</p>