How to allow tap-to-focus on the camera using an overlay
Posted
by AJJ
on Stack Overflow
See other posts from Stack Overflow
or by AJJ
Published on 2010-05-13T00:17:57Z
Indexed on
2010/05/13
0:24 UTC
Read the original article
Hit count: 588
The standard 3GS iPhone camera includes tap-to-focus (I can tap to the region I want to focus on). However when I use a custom overlay using the UIImagePickerController class, the tap to focus does not seem to work. Everything else in terms of capturing images programmatically etc is working btw.
Note that my overlay view is only a small rectangle (UIView) at the bottom of the screen. It does not cover the other areas of the camera. So I believe the taps should go through (unless I am missing something). I have seen other apps use an overlay and still provide a tap-to-focus functionality, so there must be a way to do this.
I use all the default controls set to be hidden as:
imagePicker.showsCameraControls = NO;
imagePicker.toolbarHidden = YES;
imagePicker.navigationBarHidden = YES;
Of course changing the above does not let me tap-to-focus (it just enables the toolbars, etc).
I could not find any answers on the UIImagePickerController class reference. Any help would be greatly appreciated. Thanks!
© Stack Overflow or respective owner