【问题标题】:UIImagePickerController With Camera Option both portrait and landscape mode in iPhone SDK (Is ti possible to change by using CameraOverlayView?)UIImagePickerController 在 iPhone SDK 中具有相机选项的纵向和横向模式(是否可以通过使用 CameraOverlayView 进行更改?)
【发布时间】:2023-10-21 13:16:01
【问题描述】:

我正在通过UIImagePickerController拍照。当我以人像模式拍摄照片时,它可以正确显示。但是当我在横向模式下拍摄照片时,它会自动旋转到纵向模式,然后显示出来。

当我以横向拍摄照片时,有哪些可能的方式可以在横向模式下显示拍摄的照片。

提前致谢。

如果使用CameraOverlayView??????可以吗

【问题讨论】:

  • 在您展示照片的位置?

标签: iphone ios4 uiimagepickercontroller uiinterfaceorientation


【解决方案1】:

有一个用于定位目的的方法,并且每次调用它 -BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOri‌​entation 被调用。

【讨论】:

    【解决方案2】:

    您可以使用以下方法保存带有UIImageOrientation 属性的图像:

    - (id)initWithCGImage:(CGImageRef)imageRef scale:(CGFloat)scale orientation:(UIImageOrientation)orientation
    

    这样,您也可以使用变量scale 控制缩放。抓拍UIImage时可以参考各种orientation values和使用设备方向

    【讨论】: