在我的应用程序中,我必须使用ipad的前凸轮,我必须使用前凸轮拍摄照片。我正在使用[self.imagePickerController takePicture];
方法自动拍照
有倒计时,倒数后,应用程序会自动拍照。用户可以拍摄多张照片。当用户拍摄第一张照片时,应用程序使用前凸轮,但当用户拍摄第二张照片时,应用程序正在使用后凸轮,我只想使用前凸轮。请帮忙。
我的代码如下:
- (IBAction)btnTakePic:(id)sender;
{
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
//[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
//Set Notifications so that when user rotates phone, the orientation is reset to landscape.
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.delegate = self;
imagePickerController.showsCameraControls = NO;
imagePickerController.cameraDevice= UIImagePickerControllerCameraDeviceFront;
[imagePickerController setWantsFullScreenLayout:YES];
[self presentModalViewController:imagePickerController animated:YES];
}
[NSTimer scheduledTimerWithTimeInterval:3.0
target:self
selector: @selector(targetMethod)
userInfo:nil
repeats:NO];
}
- (void)targetMethod
{
[self.imagePickerController takePicture];
}