How enable iPhone camera buttons (zoom , flash , switch)
I am trying to use camera 开发者_开发问答for my application but the problem is when I use this code the front camera is disable :
ipc.cameraDevice = UIImagePickerControllerCameraDeviceRear;
and vice versa !
ipc.cameraDevice = UIImagePickerControllerCameraDeviceFront;
how can i enable both them together ? I mean ENABLE the switch button to use front and rear camera , !!! all the buttons are disable ! Zoom , Flash , camera switch
CODE :
-(IBAction)takePic {
USImage.hidden = YES;
ipc = [[UIImagePickerController alloc]init];
ipc.delegate = self;
ipc.sourceType = UIImagePickerControllerSourceTypeCamera;
ipc.cameraDevice = UIImagePickerControllerCameraCaptureModePhoto;
ipc.cameraViewTransform = YES;
[self presentModalViewController:ipc animated:YES];
}
I use this code and it lets me switch the camera perfectly fine:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:imagePicker animated:YES];
[imagePicker release];
you can't use them at the same time
Just don't provide neither of both lines ;). If you don't set up cameraDevice, the button will be presented (and working like charm) on your ImagePickerController
精彩评论