我的 iPhone 应用程序允许用户录制视频。如何像在屏幕截图中一样自定义我的相机视图。(我还需要自定义计时器倒计时)
我的 iPhone 应用程序允许用户录制视频。如何像在屏幕截图中一样自定义我的相机视图。(我还需要自定义计时器倒计时)
您需要将所有自定义元素放在 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];
}