ios - 相机对焦ios
<p><p>我有崩溃消息:</p>
<blockquote>
<p><em>*</em> Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Setting focusPointOfInterest is not supported by this device.Use isFocusPointOfInterestSupported'</p>
</blockquote>
<p>代码后:</p>
<pre><code>-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
;
}
</code></pre>
<p>有没有办法像<strong><em>相机胶卷</em></strong>那样进行对焦?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>答案的组合,但这应该可以帮助您。</p>
<p>您需要将触摸点从触摸开始或触摸手势转换为 0-1 比例。</p>
<p>所以,检查你的设备是否有焦点,然后转换点:</p>
<pre><code>-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
// get device reference...
if () {
CGPoint point = ;
float newX = point.x / self.myCameraView.frame.size.width;
float newY = point.y / self.myCameraView.frame.size.height;
;
}
else {
// Focus not supported
}
}
</code></pre></p>
<p style="font-size: 20px;">关于ios - 相机对焦ios,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/15366550/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/15366550/
</a>
</p>
页:
[1]