0

When I invoke camera using the UIimagepicker controller it does not show in full screen mode on iPhone with iOS version 4.2, but it does work in iOS 5.

Can anyone tell me the code that needs to be changed and what is the problem with existing code?

I am using the following code:

    - (IBAction)takePicture:(id)sender 
{

    UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];

    imagePicker.delegate = self;
    imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePicker.showsCameraControls = YES;
    imagePicker.allowsEditing = NO;
    imagePicker.toolbarHidden = YES;
    imagePicker.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    imagePicker.wantsFullScreenLayout = YES;

    if ([UIImagePickerController respondsToSelector:@selector(isCameraDeviceAvailable:)])
    {
        if ([UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront])
        {
            [imagePicker setCameraDevice:UIImagePickerControllerCameraDeviceFront];


        }
    }

    // Show the camera UI and View Finder.

    [self presentModalViewController:imagePicker animated:YES];
    [imagePicker release];
}

Please check the attachment Image is here

Nat Ritmeyer
  • 5,634
  • 8
  • 45
  • 58
kumaravel
  • 1
  • 2

2 Answers2

0

one of the solution is applying scaling trasnformation - here on stack maybe it will help

Community
  • 1
  • 1
raistlin
  • 4,298
  • 5
  • 32
  • 46
0

I don't see why you are doing these 3 things:

[self.navigationController setNavigationBarHidden:YES];
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
[self.camPicker.view setUserInteractionEnabled:YES];

Or for that matter why you are caching the instance of UIImagePickerController (this may cause significantly higher idle memory usage for your application compared to discarding the image picker controller between uses). Does it work better if you don't do these things?

codercat
  • 22,873
  • 9
  • 61
  • 85