title: Resize view on iPhone when rotating
body: <p>I have an application with many views. I want only a couple of the views to be able to rotate to landscape when the device is rotated. I found out that I couldn't use <code>(BOOL)shouldAutorotateToInterfaceOrientation</code> because that would rotate every view in my app.
  I found a solution to this problem here on Stack Overflow but now I have another issue to deal with.</p>
  
  <p>The view rotates when I turn the device but it still shows the view as if it were still in portrait mode (straight up and down). The top and bottom of the view is cut off. Is there a way to have the view rotate and also adjust its size to fit the new orientation?
  I also found <a href="https://stackoverflow.com/questions/1573993/iphone-how-to-properly-resize-view-when-rotating-device">this</a> but wasn't able to get it to work.</p>
  
  <p>Here's my code for that view:</p>
  
  <pre><code>@implementation businessBank
  @synthesize webView, activityIndicator;
  
  
  - (void)viewDidLoad {
  
      [super viewDidLoad];
      NSString *urlAddress = @"website_url";
  
      NSURL *url = [NSURL URLWithString:urlAddress];
      NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
  
      [webView loadRequest:requestObj];
      [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
      [[NSNotificationCenter defaultCenter] addObserver:self
                                               selector:@selector(didRotate:)
                                                   name:UIDeviceOrientationDidChangeNotification
                                                 object:nil];
  
  }
  - (void)didRotate:(NSNotification *)notification {
  
      UIDeviceOrientation orientation = [[notification object] orientation];
  
      if (orientation == UIDeviceOrientationLandscapeLeft) {
          [self.view setTransform:CGAffineTransformMakeRotation(M_PI / 2.0)];
      } else if (orientation == UIDeviceOrientationLandscapeRight) {
          [self.view setTransform:CGAffineTransformMakeRotation(M_PI / -2.0)];
      } else if (orientation == UIDeviceOrientationPortraitUpsideDown) {
          [self.view setTransform:CGAffineTransformMakeRotation(M_PI)];
      } else if (orientation == UIDeviceOrientationPortrait) {
          [self.view setTransform:CGAffineTransformMakeRotation(0.0)];
      }
  }
  </code></pre>