0

I have an iPhone app that displays the camera using UIImagePicker to take a picture. I am porting it to iPad2 and when i want to display the camera (through a modalviewcontroller) i get the camera buttons but the display in the preview is just white. If i take the picture i can see it.

Does this happen to you?

pabloruiz55
  • 1,306
  • 1
  • 14
  • 27
  • Update: if i call [imagePicker setModalPresentationStyle:UIModalPresentationFormSheet]; on the imagepicker, i do see the camera display and the formSheet over it! So i guess that when it is full screen the same is happening. What could be the reason for the modalviewcntroller's view to show OVER the imagepicker? – pabloruiz55 Apr 30 '11 at 21:53

2 Answers2

1

I am experiencing the same problem. I moved the UIImagePicker code to my rootviewcontroller, and it worked. I could see what was actually through the viewfinder. It also worked via a popover in the existing viewcontroller (called next after the rootviewcontroller), but the resolution was poor when I displayed the photo. This is not satisfactory, but I guess I found a workaround if absolutely necessary.

Carrie
  • 11
  • 2
0

Yesterday only i have tried this code to use camera to take pics. from my app and it worked on iphone after porting it.

I think you need to call takePicture method on the controller.

Just a guess.

if([UIImagePickerController isSourceTypeAvailable:sourceType])
{
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.sourceType = sourceType;
    picker.delegate = self;
    if(sourceType == UIImagePickerControllerSourceTypeCamera)
        [picker takePicture];
    [self presentModalViewController:picker animated:YES];
    [picker release];
}
Robin
  • 10,011
  • 5
  • 49
  • 75