我想知道这是否真的可行。我知道我可以翻转 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/