gpt4 book ai didi

ios - 非模态 UIImagePickerController,点击聚焦不起作用

转载 作者:可可西里 更新时间:2023-11-01 05:41:42 24 4
gpt4 key购买 nike

我在非模态设置中使用 UIImagePickerController,如下所示:

UIImagePickerController *_imagePickerVC = // init the VC with the main camera as the source
[_mainCameraPreviewContainer addSubview:_imagePickerVC.view];
[_mainCameraPreviewContainer bringSubviewToFront:_imagePickerVC.view];

这行得通,我可以拍照,但我无法点击预览区域使相机聚焦在该点上。我尝试通过添加以下两行中的一行或两行来解决此问题:

_imagePickerVC.showsCameraControls = NO;
_imagePickerVC.view.userInteractionEnabled = YES;

但运气不好。当我让它显示相机控件时,我确实得到了闪光灯模式按钮和选择相机的按钮,但这些按钮也不可点击。在我的情况下是否可以让轻触集中工作?

最佳答案

我重复了你的代码并点击聚焦和按钮工作。 (iOS 5.1、6.1)。

- (IBAction)buttonTap:(id)sender {
if (!_imagePickerVC)
{
_imagePickerVC = [UIImagePickerController new];
_imagePickerVC.sourceType = UIImagePickerControllerSourceTypeCamera;
}

[self.view addSubview:_imagePickerVC.view];
[self.view bringSubviewToFront:_imagePickerVC.view];
}

确保 mainCameraPreviewContainer.userInteractionEnabled == YES

关于ios - 非模态 UIImagePickerController,点击聚焦不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15178860/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com