0

我的 iPhone 应用程序允许用户录制视频。如何像在屏幕截图中一样自定义我的相机视图。(我还需要自定义计时器倒计时)

在此处输入图像描述 在此处输入图像描述

4

1 回答 1

0

您需要将所有自定义元素放在 a 中UIView并将该视图分配给cameraOverlayView属性。

- (void)takePicture {
    if (([UIImagePickerController isSourceTypeAvailable:
          UIImagePickerControllerSourceTypeCamera] == NO)) return;

    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.delegate = self;
    imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
    // add a custom view overlay
    [imagePickerController setCameraOverlayView:customView];

    [self presentModalViewController:imagePickerController animated:YES];
    [imagePickerController release];
}

另请参阅http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple_ref/occ/instm/UIImagePickerController/cameraOverlayView

于 2013-01-25T12:31:00.243 回答