【问题标题】:How can I show the camera but not let the user take a photo?如何显示相机但不让用户拍照?
【发布时间】:2012-06-11 02:12:25
【问题描述】:

如何让用户看到前置摄像头,但阻止他们在 iPhone 4/4s 和/或 iPod Touch 4 上拍照、录像或切换到后置摄像头?

【问题讨论】:

    标签: objective-c ios camera


    【解决方案1】:
    cameraPicker = [[UIImagePickerController alloc] init];
    ....
    cameraPicker.showsCameraControls = NO;
    cameraPicker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
    

    【讨论】:

    • 当我复制代码时,它说它找不到cameraPicker。我还需要做什么?
    • @coryginsberg 回答已编辑。一个 UIImagePickerController 对象。
    【解决方案2】:

    您可以使用 AVFoundation 框架打开相机。

    试试这个示例代码https://developer.apple.com/library/ios/#samplecode/AVCam/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010112

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-06-04
      • 2016-05-11
      • 1970-01-01
      • 2012-05-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多