【问题标题】:UIImagePickerController camera automatically converts image to portraitupUIImagePickerController 相机自动将图像转换为纵向
【发布时间】:2014-05-10 15:35:39
【问题描述】:

我已致电UIImagePickerController 拍照,但每次我拍照时,相机都会自动将图像转换为纵向,尽管我想以拍摄时的方向拍摄图像。

在didFinishPickingMediaWithInfo方法中,返回的图像每次都有方向UIImageOrientationUp。

在我的父控制器中,我有以下代码:

-(BOOL)shouldAutorotate
{
    return YES;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskAll;
}

【问题讨论】:

    标签: ios uiimagepickercontroller uiimageorientation


    【解决方案1】:

    要在上传时旋转 UIImage 以正确显示,您可以使用这样的类别:

    UIImage+fixOrientation.h

    Here

    【讨论】:

      猜你喜欢
      • 2013-07-31
      • 1970-01-01
      • 2020-02-21
      • 2023-01-30
      • 2011-11-19
      • 1970-01-01
      • 1970-01-01
      • 2015-10-25
      • 2013-07-31
      相关资源
      最近更新 更多