In my iPhone application i have a UIImagePickerController for take photos. I have hide all default camera controls and added UIView with Two button as a CameraOverLayView in UIImagePickerController. My application is always run in Landscape mode only. The Camera is also launching Landscape mode only. Now, the CameraOverlayView is only in Landscape Left side not change to Landscape to Right. How can i change the CameraOverlayView LandscapeMode Left and Right when the device orientation will changing? Please help me to fix it. It is major problem in my app. This code hold the Overlayview in Landscape mode Left
imgpicker.cameraOverlayView.transform = CGAffineTransformRotate(CGAffineTransformIdentity, 117.81);
and this code hold the cameraoverlayview in Landscape mode right GAffineTransform transform = self.view.transform;
transform = CGAffineTransformRotate(transform, (M_PI / 2.0));
imgpicker.cameraOverlayView.transform = transform;
I used these codes in UIInterfaceOrientation methods like this,
UIInterfaceOrientation orientation= [[UIApplication sharedApplication] statusBarOrientation];
if (orientation == UIInterfaceOrientationLandscapeLeft)
{
imgpicker.cameraOverlayView.transform = CGAffineTransformRotate(CGAffineTransformIdentity, 117.81);
}
else if (orientation == UIInterfaceOrientationLandscapeRight)
{
CGAffineTransform transform = self.view.transform;
transform = CGAffineTransformRotate(transform, (M_PI / 2.0));
imgpicker.cameraOverlayView.transform = transform;
}
But, these are not helping me. When i rotate the device orientation landscape left and right, the cameraoverlayview does not changing. Can you please fix my problem? Thanks.