-1

我在我的应用程序中使用 UIImagePickerController 来拍摄视频。我的问题很简单:如何使视图中的按钮更大,特别是视频拍摄完成后出现的“使用”按钮?

4

1 回答 1

1

您需要向 UIImagePickerController 添加自定义叠加层。然后使用自定义按钮而不是原始按钮。

像这样:

    UIImagePickerController *picker = [[UIImagePickerController alloc]init];
    picker.delegate = self;
    //hide old buttons
    picker.showsCameraControls = NO;

    UIView *overlay = [[UIView alloc] init];
    UIButton *newButton = [UIButton buttonWithType:UIButtonTypeCustom];
    newButton.frame = CGRectMake(20,40,70,40);
    [overlay addSubview:newButton];

    picker.cameraOverlayView = overlay;

然后将新按钮添加到覆盖 uiview。

至于新按钮操作,您需要查看苹果文档以查看原始按钮的方法。(比如拍摄你会使用的照片 - [picker takePicture];)

希望这可以帮助!

于 2013-06-27T23:55:29.267 回答