Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想这样做:当相机对焦时,应用程序会自动拍照。但我发现没有办法检测相机是否对焦。
我怎么知道相机是否对焦?
AVCuptureDevice你应该检查是否支持焦点。并非所有 iOS 设备都支持对焦,因此您确实需要通过调用检查是否支持对焦isFocusModeSupported:
AVCuptureDevice
isFocusModeSupported:
然后开始监控adjustingFocus财产。这会告诉您设备是否正在对焦。
adjustingFocus
因此,虽然adjustingFocus返回YES不拍照,但如果它更改为NO设备,则应聚焦。
YES
NO