Take a picture on iPhone without showing controls

前端 未结 2 1893
不思量自难忘°
不思量自难忘° 2020-12-01 00:47

Is there a way to take a picture in code on the iPhone without going through the Apple controls? I have seen a bunch of apps that do this, but I\'m not sure what API call t

2条回答
  •  Happy的楠姐
    2020-12-01 01:47

    Yes, there are two ways to do this. One, available in iOS 3.0+ is to use the UIImagePickerController class, setting the showsCameraControls property to NO, and setting the cameraOverlayView property to your own custom controls. Two, available in iOS 4.0+ is to configure an AVCaptureSession, providing it with an AVCaptureDeviceInput using the appropriate camera device, and AVCaptureStillImageOutput. The first approach is much simpler, and works on more iOS version, but the second approach gives you much greater control over photo resolution and file options.

提交回复
热议问题