iOS:切换到横向模式时 Webview 不缩放
<p><p>自从升级到 Xcode 4.2 后,当我改变方向时,WebView 无法正确缩放</p>
<p>我使用这个代码:</p>
<pre><code>NSLog(@"Show link: %@",URL);
]];
showStory.scalesPageToFit = YES;
showStory.contentMode = UIViewContentModeScaleAspectFit;
</code></pre>
<p>但是当我切换到横向模式时会发生这种情况。有什么建议吗?</p>
<p> <img src="/image/X938x.png" alt="enter image description here"/> </p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><pre><code>Try this
webView.scalesPageToFit = YES;
webView.contentMode = UIViewContentModeScaleToFill;
webView.multipleTouchEnabled = YES;
webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
;
</code></pre></p>
<p style="font-size: 20px;">关于iOS:切换到横向模式时 Webview 不缩放,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/9041880/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/9041880/
</a>
</p>
页:
[1]