【发布时间】:2014-07-15 11:56:35
【问题描述】:
我添加 UIImagePickerController 的代码:
picker = [[[UIImagePickerController alloc] init] autorelease];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.showsCameraControls = NO;
[self displayContentController:picker inView:cameraBoxView];
[self.view sendSubviewToBack:picker.view];
- (void)displayContentController:(UIViewController *)content inView:(UIView *)v {
//Delete the previous instance of the same view controller
for (UIViewController *vc in self.childViewControllers) {
if ([vc isKindOfClass:[content class]]) {
[vc removeFromParentViewController];
}
}
[self addChildViewController:content];
content.view.frame = v.frame;
[self.view addSubview:content.view];
[content didMoveToParentViewController:self];
if ([content isKindOfClass:[CCInnerNavigationController class]]) {
innerNavigationController = (CCInnerNavigationController *)content;
}
}
我已禁用除纵向之外的所有设备方向。但是来自相机的图像是旋转的。如何在 iOS 6 和 7 中解决此问题。
附:我知道有很多解决方案,但它们似乎太旧了,因为它们都不起作用。
【问题讨论】:
标签: ios camera rotation uiimagepickercontroller autorotate