title: Black Bar in UIImagePicker on iPad - Only in Landscape Right Orientation
body: <p>I am showing a UIImagePicker (itself in a UIView) via a UIPopOver. This works fine, however when the iPad is rotated onto its right side I get a strange black bar along the left hand side of the popover as per the image below. The cancel button is also partially off the right hand of the screen. This doesn't happen in any other orientation which is odd.</p>
  
  <p>The code is also listed below. Can anyone suggest why I am getting this black bar ?</p>
  
  <pre><code>imagePickerController = [[UIImagePickerController alloc] init];
  imagePickerController.delegate = self;
  imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
  
  CGFloat width = CGRectGetWidth(self.view.bounds);
  CGFloat height = CGRectGetHeight(self.view.bounds);
  
  UIViewController *containerController = [[UIViewController alloc] init];
  containerController.contentSizeForViewInPopover = CGSizeMake(width, height);
  [imagePickerController.view setFrame:containerController.view.frame];
  [containerController.view addSubview:imagePickerController.view];
  
  
  
  if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
      Class cls = NSClassFromString(@"UIPopoverController");
      if (cls != nil) {
  
          popoverController = [[UIPopoverController alloc] initWithContentViewController:containerController];
  
          [popoverController presentPopoverFromRect:selectedRect inView:self.view permittedArrowDirections:4 animated:YES];
  
          [containerController release];
  
      }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/IYSJy.jpg" alt="Screenshot"></p>