If the UIWebView is a subview of a View Controller, the view controller will support auto-rotation so you should be able to tell the UIWebView (and all subviews) to auto-rotate.
Make sure you have that option selected for the parent view in IB (checkbox in Attributes -> Autoresize subviews), also I think your method can be just:
Code:
- (BOOL)shoudlAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight)
{ return YES; }
}
I really don't think you need to work with the frame. The problem if you start messing with the frame is you probably need to manually rotate as well, something like
Code:
CGAffineTransform transform = CGAffineTransformMakeRotation(90 / 180.0 * M_PI);
webView1.view.transform = transform;