title: UIImagePickerController cameraViewTransform acts differently in iOS 4
body: <p>I upgraded both my iPhone and SDK to iOS 4.0.1 and now my App doesn't run the same way it was running in iOS 3.x.</p>
  
  <p>My App uses the UIImagePickerController with a custom cameraOverlayView (which I'll suppress in this post). The main point is that I need to see the iphone camera in fullscreen mode. To go straight to the problem, I'll put some code and screenshots to explain what's happening.</p>
  
  <p>I created a View-Based Application using the XCode Template projects named "CameraTransform", so I got two classes: <code>CameraTransformAppDelegate</code> and <code>CameraTransformViewController</code>, ok! In  the <code>CameraTransformViewController</code>'s <code>viewDidAppear</code> method I put the following code:</p>
  
  <pre><code>- (void)viewDidAppear:(BOOL)animated {
      [super viewDidAppear:animated];
  
      UIImagePickerController* picker = [[UIImagePickerController alloc] init];
  
      picker.sourceType = UIImagePickerControllerSourceTypeCamera;        
      picker.delegate = self;
  
      //[self configurePicker_FirstAttempt:picker];   Use this!
      //[self configurePicker_SecondAttempt:picker];  Use this too!
  
      [self presentModalViewController:picker animated:YES];
  }
  
  - (void)configurePicker_FirstAttempt:(UIImagePickerController*) picker {
      picker.showsCameraControls = NO;
      picker.navigationBarHidden = YES;
  
      // not needed (use defaults)
      //picker.toolbarHidden = YES;
      //picker.wantsFullScreenLayout = YES;
  }
  
  - (void)configurePicker_SecondAttempt:(UIImagePickerController*) picker {
  
      // Transform values for full screen support
      CGFloat cameraTransformX = 1.0;
      CGFloat cameraTransformY = 1.12412;
  
      picker.cameraViewTransform = CGAffineTransformScale(picker.cameraViewTransform, cameraTransformX, cameraTransformY);
  }
  </code></pre>
  
  <p>Running the project with/i got:</p>
  
  <ul>
  <li>both <code>configurePicker_FirstAttempt</code> and <code>configurePicker_SecondAttempt</code> method calls commented: <a href="http://educoelho.com/files/defaultPicker.png" rel="noreferrer">defaultPicker.png</a>.</li>
  <li>only <code>configurePicker_SecondAttempt</code> method call commented: <a href="http://educoelho.com/files/configurePicker_FirstAttempt.png" rel="noreferrer">configurePicker_FirstAttempt.png</a>.</li>
  <li>both <code>configurePicker_FirstAttempt</code> and <code>configurePicker_SecondAttempt</code> method calls uncommented: <a href="http://educoelho.com/files/configurePicker_SecondAttempt.png" rel="noreferrer">configurePicker_SecondAttempt.png</a>.</li>
  </ul>
  
  <p>NOTE:</p>
  
  <ol>
  <li>In iOS 3.x I used the third approach (both methods uncommented) to configure the picker, which was show in the fullscreen mode without the "black bar" at the bottom.</li>
  <li>I inspected the <code>picker.cameraViewTransform</code> original value (before being scaled) and it is set to Identity (as expected).</li>
  <li>The <code>picker.view.frame</code> is set to the screen bounds's (0.0, 0.0, 320.0, 480.0)</li>
  <li>I tried to concatenate a translation to the <code>picker.cameraViewTransform</code> (after being scaled), like this: <code>CGAffineTransformTranslate(picker.cameraViewTransform, 0.0, 20.0);</code> and I realized that there was some part of the "camera view" that was hidden (maybe it's origin wasn't the 0.0, 0.0), so I got more "camera view" on screen.</li>
  </ol>
  
  <p>It looks like in the new SDK the UIImagePickerController has changed in some way, maybe the camera controls have different sizes os something alike.</p>
  
  <p>Has anyone had this problem?</p>