Reputation: 883
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?
Upvotes: 2
Views: 4462
Reputation: 832
Try this
webView.scalesPageToFit = YES;
webView.contentMode = UIViewContentModeScaleToFill;
webView.multipleTouchEnabled = YES;
webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view addSubview:webView];
Upvotes: 3
Reputation: 1943
You need to tick the scales page to fit option in the webView Attribute inspector.
Upvotes: 0