ios - UIImagePickerController 错误旋转

标签 ios iphone objective-c rotation uiimagepickercontroller

我在 ViewController( Collection View )中使用 UIImagePickerController。

旋转设备时,我在图片下方遇到一些错误。

1.肖像模式:可以。

enter image description here

2.横向模式:可以。

enter image description here

3.选择操作表:UIImagePickerController:就可以了。

enter image description here

4.选择相机胶卷:自动旋转为纵向

enter image description here

5.相机胶卷上触摸取消:mainViewController自动旋转到纵向

enter image description here

我想要

1) 当触摸相机胶卷时,它会以横向模式显示

2)触摸取消后返回mainView,mainView显示Landscape

附言该项目可以横向和纵向,此问题仅发生在横向上。

谢谢你,对我的英语感到抱歉。

最佳答案

请阅读DOCUMENT明明说只支持PORTRAIT MODE

enter image description here

IMPORTANT

The UIImagePickerController class supports portrait mode only. This class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified, with one exception. You can assign a custom view to the cameraOverlayView property and use that view to present additional information or manage the interactions between the camera interface and your code.

因此,当您进入照片库时,它将处于纵向模式,当选择图像或取消时,它将返回到您之前使用的任何模式。

关于ios - UIImagePickerController 错误旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23127417/

相关文章:

ios - 如何在另一种方法之后调用 segue

iphone - 有没有办法暂停核心动画并在稍后恢复它?

iphone - 将音频输出重定向到电话扬声器,将麦克风输入重定向到耳机

iphone - EventKit 同步问题

iphone - iOS电话簿中的自定义UITextField

iphone - 音频流API:Wifi与什么?

iphone - 如何调用 - (BOOL)应用程序 :(UIApplication *)application handleOpenURL:(NSURL *)url from another class

ios - 无法在iOS中播放RTMP实时视频流

iphone - 如何使用 Google Custom Search 在 objective c 中进行图片搜索

ios - 通知中心值第一次、第二次没有更新