自定义iphone cameraview(叠加)

时间:2013-01-25 08:18:52

标签: iphone objective-c camera uiimagepickercontroller

我的iPhone应用程序允许用户录制视频。 如何在屏幕截图中自定义我的相机视图。(我还需要自定义timer-countDown)

enter image description here enter image description here

1 个答案:

答案 0 :(得分:0)

您需要将所有自定义元素放在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