在我的IOS应用程序中,当我打开相机时,我已经在相机视图上放置了一张图像。它在肖像模式下看起来不错。但是当它被改变为横向模式时,它看起来有点奇怪。所以我想在肖像模式下锁定UIImagePickerController。
下面是我的ui图像选择器控制器代码。
UIImagePickerController *imgPkr = [[UIImagePickerController alloc] init];
imgPkr.delegate = self;
imgPkr.sourceType = UIImagePickerControllerSourceTypeCamera;它是如何在纵向模式下锁定的...
发布于 2012-04-23 22:28:59
这不是最好的解决方案,但它是有效的:
AppDelegate *appDelegate = (AppDelegate *) [[UIApplication sharedApplication] delegate];
[appDelegate.window addSubview:cameraOverlay];
imgPicker.cameraOverlayView = appDelegate.window.superview;背景上的摄像头仍在旋转,但您的叠加视图不会。希望它能为您工作
https://stackoverflow.com/questions/8940443
复制相似问题