简体   繁体   English

iOS中的全屏摄像头

[英]full screen camera in ios

I'm using the following code so the user can take a pic: 我正在使用以下代码,以便用户可以拍照:

- (IBAction)takePhoto:(UIButton *)sender {

    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;
    picker.allowsEditing = YES;
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;

    [self presentViewController:picker animated:YES completion:NULL];

}

Is there a way to make the camera occupy the hole screen? 有没有办法使相机占据孔眼?

What you're seeing is the default implementation of UIImagePickerController which includes camera controls. 您将看到的是UIImagePickerController的默认实现,其中包括相机控件。

Try turning these off by setting showsCameraControls to NO . 尝试通过将showsCameraControls设置为NO来关闭它们。

If you want to add your own controls, use cameraOverlayView . 如果要添加自己的控件,请使用cameraOverlayView

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM