I'm building an app using the UIImagePickerController and a custom Overlay. With the iPhone 5 screen size adding 88 points but the camera view port staying roughly the same size I was wondering how people have tackled this issue? I'm really against hardcoding values or making assumptions based on screen height, especially with Apple rumoured to be releasing another device with another set of screen dimensions next week.
Asked
Active
Viewed 1,609 times
1
-
The first step is: You can turn off **showsCameraControls**, and make your own custom UIView for **cameraOverlayView**. In that view, you can (as you wish) duplicate the look of the Apple controls. By doing so, you "get rid of" that "handy" (!) black bar Apple give you, and you can just create and size your own "black bar" at the bottom and perhaps top. So, you're still using UIImagePickerController. We find all of this works well in production apps. Then just as CSmith says, the next step would be abandoning UIImagePickerController and going to AVFoundation. – Fattie Mar 01 '14 at 09:34
1 Answers
3
Unfortunately with this being a private View Controller, you really can't safely probe into it to see what's really going on. What I've determined is that the toolbar has gone from about 54 pixels to about 92, but hard-coding such things is probably going to end up biting you someday.
I ended up rolling my own camera using AVFoundation .... this gave complete control over the scale and location of the preview view, and also any overlay you want to put on top of it.
You can download Apple Samples like SquareCam which will give you much of what you need, and abandon UIImagePickerController altogether.

CSmith
- 13,318
- 3
- 39
- 42