iPad2 相机显示屏不显示

发布于 2024-11-04 10:43:25 字数 132 浏览 0 评论 0原文

我有一个 iPhone 应用程序,它使用 UIImagePicker 显示相机来拍照。我将其移植到 iPad2,当我想显示相机(通过模态视图控制器)时,我得到相机按钮,但预览中的显示只是白色。如果我拍照我就能看到它。

你有这种情况吗?

I have an iPhone app that displays the camera using UIImagePicker to take a picture. I am porting it to iPad2 and when i want to display the camera (through a modalviewcontroller) i get the camera buttons but the display in the preview is just white. If i take the picture i can see it.

Does this happen to you?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

荒岛晴空 2024-11-11 10:43:25

我遇到了同样的问题。我将 UIImagePicker 代码移至我的 rootviewcontroller,并且它起作用了。我可以通过取景器看到实际情况。它也可以通过现有视图控制器中的弹出窗口(在根视图控制器之后调用)来工作,但是当我显示照片时,分辨率很差。这并不令人满意,但我想如果绝对必要的话我找到了解决方法。

I am experiencing the same problem. I moved the UIImagePicker code to my rootviewcontroller, and it worked. I could see what was actually through the viewfinder. It also worked via a popover in the existing viewcontroller (called next after the rootviewcontroller), but the resolution was poor when I displayed the photo. This is not satisfactory, but I guess I found a workaround if absolutely necessary.

倾`听者〃 2024-11-11 10:43:25

昨天我才尝试过这个代码来使用相机拍照。来自我的应用程序,移植后它可以在 iPhone 上运行。

我认为你需要在控制器上调用 takePicture 方法。

只是一个猜测。

if([UIImagePickerController isSourceTypeAvailable:sourceType])
{
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.sourceType = sourceType;
    picker.delegate = self;
    if(sourceType == UIImagePickerControllerSourceTypeCamera)
        [picker takePicture];
    [self presentModalViewController:picker animated:YES];
    [picker release];
}

Yesterday only i have tried this code to use camera to take pics. from my app and it worked on iphone after porting it.

I think you need to call takePicture method on the controller.

Just a guess.

if([UIImagePickerController isSourceTypeAvailable:sourceType])
{
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.sourceType = sourceType;
    picker.delegate = self;
    if(sourceType == UIImagePickerControllerSourceTypeCamera)
        [picker takePicture];
    [self presentModalViewController:picker animated:YES];
    [picker release];
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文