8

在此处输入图像描述

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

我们使用了以下代码

    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];
}
4

3 回答 3

3

this view is brought to you by showsCameraControls property of UIImagePickerController class

If you set it to NO you won't see that screen, but you will have to provide camera controls.

Your alternative is to use AVFoundation which will give you full flexibility on how it looks and performs. Although it will take a bit more time to setup, it will pay-off in the long run.

于 2013-04-15T14:30:53.110 回答
0

我使用 swizzle 来解决这个问题,虽然有点 hack ......

使用揭示我知道快门按钮的类名是 CAMShutterButton,它是 UIButton 的子类

所以我只是在加载到超级视图时隐藏这个按钮,并放置一个自定义快门按钮来发送 takePicture 消息

好吧,既然我可以隐藏它,我实际上可以将目标操作添加到此按钮或使用通知

记得在调用 takePicture 之前 setShowsCameraControls 跳过重拍和使用

没有快门按钮的相机

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

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
于 2014-07-31T12:31:12.680 回答
0

关于什么?

imagepicker.allowsEditing = 否

于 2016-01-18T18:17:14.890 回答