ios - 在 iOS7 上拍照时,有没有办法使用代码让它不水平翻转?

标签 ios objective-c uiimageview camera

我想知道这是否真的可行。我知道我可以翻转 UIImageView,但 iOS 7 上的相机显示图片在您选择它以在 uiimageview 中显示之前水平翻转。有什么办法可以解决这个烦恼吗?如果有请告诉我。这对用户来说可能非常烦人,因为他们可能不知道更好。 编辑:这是我的代码。

        UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];

    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
    {
        [imagePickerController setSourceType:UIImagePickerControllerSourceTypeCamera];
    }

    // image picker needs a delegate,
    [imagePickerController setDelegate:self];

    // Place image picker on the screen
    [self presentModalViewController:imagePickerController animated:YES];

最佳答案

根据 Apple's UIImagePickerClass Reference,您不能轻易做到这一点:

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.

这意味着如果你想弄乱方向,你将需要创建自己的相机 Controller 并自行处理。查看this stack overflow question and answer了解更多信息。编码愉快!

关于ios - 在 iOS7 上拍照时,有没有办法使用代码让它不水平翻转?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20503841/

相关文章:

ios - 如何使用 FMDB 从 sqlite 检索数据并保存在数组中

properties - 嵌入在 UIScrollView 中的 UIImageView 和 UIImage 属性的强或弱声明?

iphone - UIWebView webViewDidStartLoad 有时不触发

iphone - 如何使用 fb ://url 从其他应用程序打开 iphone fb 应用程序中的照片

ios - UIView.animate 似乎卡住了其他 View 更新

iphone - 覆盖 UITextView 中的自动滚动?

objective-c - 安装应用程序后运行相同的代码

ios - 从在 iOS 8 中工作但在 iOS 7 中不工作的已保存屏幕截图设置 UIImageView 图像

ios - 如何在 UIImageView 之上添加交互式 UILabel?

ios - 如何为 arm64 位支持 iOS 构建 libssh2