gpt4 book ai didi

ios 7 图像选择器在 popover 中的错误行为

转载 作者:IT王子 更新时间:2023-10-29 07:59:27 24 4
gpt4 key购买 nike

我的图像选择器 View Controller 设置在弹出框 Controller 内。在 iOS 6 上一切正常,但在 iOS 7 上图像旋转并且所有移动都在做诗句:当向左转动 iPad 时图像向下,向上移动时图像向左,等等。

这是显示我的相机的代码:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;

objPopView = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
[objPopView presentPopoverFromRect:CGRectMake(842, 163, 0, 0)
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionRight
animated:YES];

我的应用仅使用横向模式,现在图像已旋转: enter image description here

最佳答案

作为Apple's Official Doc说:

Present the user interface. On iPhone or iPod touch, do this modally (full-screen) by calling the presentViewController:animated:completion: method of the currently active view controller, passing your configured image picker controller as the new view controller.

On iPad, the correct way to present an image picker depend on its source type, as summarized in this table:

  • Camera Photo: Use full screen
  • Library Saved: Must use a popover
  • Photos Album: Must use a popover

...

On iPad, if you specify a source type of UIImagePickerControllerSourceTypeCamera, you can present the image picker modally (full-screen) or by using a popover. However, Apple recommends that you present the camera interface only full-screen.

尽管它说 “您可以以模式(全屏)或使用弹出窗口显示图像选择器”,正如您所见,使用弹出窗口会导致这个奇怪的问题。我想这可能是 iOS 7 SDK 上的错误。

我仍在努力解决这个问题,但目前,我能说的唯一方法是通过模态方式显示它

-presentViewController:animated:completion:

方法,全屏(其实我不喜欢这种方式)

还有一个 THREAD Apple 的开发者论坛上讨论过它,你可以看看它。 ;)

关于ios 7 图像选择器在 popover 中的错误行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19026329/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com