当我使用控制器调用相机时,UIimagepicker
它不会在 iOS 4.2 版本的 iPhone 上以全屏模式显示,但它在 iOS 5 中确实有效。
谁能告诉我需要更改的代码以及现有代码有什么问题?
我正在使用以下代码:
- (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];
}
请检查附件 图片在这里