UIImagePickerController,UIPopoverController,iPad
在我的应用程序内部,照片视图和拍摄的照片在“人像”模式下是预期的,即HomeButton 在底部。但是只使用iPad,(iPhone很好)如果我使用Landscape,并将iPad相机指向靠在房子上的梯子,从地面到屋檐,屋檐沿着popOver的右侧垂直运行相机视图。 也就是说,弹出式摄像机观察器已旋转到正确位置(观察者的长边平行于设备的长边,但显示的图像向右旋转90度。 我该如何解决这个问题?
感谢阅读,Mark
- (IBAction)grabPhotoAction
{
UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = (cameraSelected) ?
UIImagePickerControllerSourceTypeCamera : UIImagePickerControllerSourceTypePhotoLibrary;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
self.myPopover = [[classPopoverController alloc] initWithContentViewController:imagePicker];
[myPopover presentPopoverFromRect:CGRectMake(0.0, 0.0, 400.0, 400.0)
inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}else {
[self presentViewController:imagePicker animated:NO completion:NULL];
}
}
答案 0 :(得分:0)
我在发布此问题之前就在网上找到了答案。我认为它可能对其他人有帮助。答案很简单。忘了使用iPad的特殊处理,只需在iPhone和iPad上全屏显示。
- (IBAction)grabPhotoAction
{
UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = (_cameraSelected) ?
UIImagePickerControllerSourceTypeCamera : UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:imagePicker animated:NO completion:NULL];
}