gpt4 book ai didi

ios - 使用 UIImagePickerController 时额外的 "ghoSTLy"相机按钮

转载 作者:可可西里 更新时间:2023-11-01 03:19:49 24 4
gpt4 key购买 nike

在社区应用程序开发中,我的任务是将 iPhone 应用程序制作成 iPad 应用程序。

按照文档,我使用以下代码生成我的相机 View :

    if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
self.imagePickerController = [[UIImagePickerController alloc] init];
self.imagePickerController.delegate = self;
self.imagePickerController.sourceType = sourceType;
if (sourceType == UIImagePickerControllerSourceTypeCamera) {
if ([UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront]) {
self.imagePickerController.cameraDevice = UIImagePickerControllerCameraDeviceFront;
}
self.imagePickerController.allowsEditing = YES;
self.imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
}

popover = [[UIPopoverController alloc] initWithContentViewController:self.imagePickerController];
[popover presentPopoverFromRect:self.profilePicture.frame
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
return;
}

但是当生成时,我得到这个烦人的“特别幽灵般”的相机按钮......

This button is NOT welcome...

这不管用,似乎只是在 mock 我。

如果我要求对象隐藏其输入按钮,所有按钮都会消失。我看不出有什么办法可以告诉那个特定的按钮关闭草皮。

更新

我发现它只是第一次出现。如果我关闭并重新打开弹出窗口,它就消失了......

最佳答案

遗憾的是,这似乎是 iOS 6 本身的一个错误。但是,有一些可能的解决方法。

您可以将图像选择器的 showsCameraControls 属性设置为 false。这将移除幽灵般的图像,但是,其他控件也将被移除。您必须使用按钮和诸如此类的东西编写自己的 View 才能调用正确的操作。

你说如果你关闭并重新打开弹出窗口,按钮就会消失。您可以将选取器的 showsCameraControls 属性设置为 false,然后在显示选取器之前恢复为 true。如果它不起作用,请尝试在选择器初始化时创建一种伪造的打开/关闭操作。

关于ios - 使用 UIImagePickerController 时额外的 "ghoSTLy"相机按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17805706/

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