iOS:切换到横向模式时 Webview 不缩放
自从升级到 Xcode 4.2 以来,当我更改方向时,Web 视图无法正确缩放,
我使用此代码:
NSLog(@"Show link: %@",URL);
[showStory loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:URL]]];
showStory.scalesPageToFit = YES;
showStory.contentMode = UIViewContentModeScaleAspectFit;
但是当我切换到横向模式时,会发生这种情况。有什么建议吗?
Since upgrading to Xcode 4.2, web views do not scale correctly when I change orientation
I use this code:
NSLog(@"Show link: %@",URL);
[showStory loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:URL]]];
showStory.scalesPageToFit = YES;
showStory.contentMode = UIViewContentModeScaleAspectFit;
But this happens when I switch to landscape mode. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要在 webView 属性检查器中勾选比例页面以适应选项。
You need to tick the scales page to fit option in the webView Attribute inspector.