繁体   English   中英

UIIMagePickerController +相机+全屏拍摄照片

[英]UIIMagePickerController + Camera + full screen capture photo

嗨,我正在将UIImagePickerController与源类型的camera一起使用。 我想知道它没有像iOS联系人应用程序那样显示完整的捕获模式(从相机中获取个人资料照片)。

我的代码显示黑屏的顶部和底部栏,iOS本机显示全屏,以捕获下一个重新拍摄屏幕。

这是我的屏幕截图 在此处输入图片说明

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

imagePickerController.delegate = self;
imagePickerController.mediaTypes = [NSArray arrayWithObjects:(NSString *)kUTTypeImage, nil];
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;

UIView *controllerView = imagePickerController.view;

controllerView.alpha = 0.0;
controllerView.transform = CGAffineTransformMakeScale(0.5, 0.5);

[[[[UIApplication sharedApplication] delegate] window] addSubview:controllerView];

[UIView animateWithDuration:0.3
              delay:0.0
            options:UIViewAnimationOptionCurveLinear
         animations:^{
             controllerView.alpha = 1.0;
         }
         completion:nil];

我相信这是UIImagePickerController的默认行为(至少在某些设备上,捕获区域周围有黑条)。

Contacts应用程序可能只是在演示之前更改了它的-cameraViewTransform属性,以使用捕获视图填充整个屏幕,但是此设置根据要使用的设备和捕获质量而有所不同。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM