Iphone 如何跳过&x27;重新制作并使用';从相机捕获照片后的选项

Iphone 如何跳过&x27;重新制作并使用';从相机捕获照片后的选项,iphone,ios,objective-c,camera,Iphone,Ios,Objective C,Camera,如何在从相机捕获照片后跳过“重新拍摄并使用”选项,或者如何更改这些按钮的字体和颜色 我们使用了以下代码 self.gimgPicker = [[GKImagePicker alloc] init]; self.gimgPicker.cropSize = CGSizeMake(310, 310); self.gimgPicker.delegate = self; self.gimgPicker.desiredSize = CGSizeMake(640, 640);

如何在从相机捕获照片后跳过“重新拍摄并使用”选项,或者如何更改这些按钮的字体和颜色

我们使用了以下代码

    self.gimgPicker = [[GKImagePicker alloc] init];
    self.gimgPicker.cropSize = CGSizeMake(310, 310);
    self.gimgPicker.delegate = self;
    self.gimgPicker.desiredSize = CGSizeMake(640, 640);
    imgPicker = [[UIImagePickerController alloc] init];
            // Set type to Photo Library if button at index is selected
            if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) {

                self.gimgPicker.imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
                [parentController presentModalViewController:self.gimgPicker.imagePickerController animated:YES];
}

此视图由
UIImagePickerController
类的属性提供

如果将其设置为
NO
,您将看不到该屏幕,但必须提供摄像头控制


您的选择是使用它,它将在外观和性能方面给您充分的灵活性。虽然安装起来需要更多的时间,但从长远来看,它会有回报的

我用swizzle来解决这个问题,不过有点不对劲

使用Review,我知道ShutterButton的类名是CAMShutterButton,它是UIButton的一个子类

所以我只是在加载到superview时隐藏这个按钮,然后放置一个自定义快门按钮来发送拍摄信息

因为我可以隐藏它,所以我可以将目标动作添加到这个按钮或使用Notificationo

记得在通话前设置showscameracontrols以跳过重拍和使用

然后你可以做任何你想做的事

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
那怎么办


imagepicker.allowsEditing=NO

为了让它更清晰,我在这里找到了这个演示,这也是repo