I have an app targeting iPhone. The UIImagePickerController
works fine on iPhone, but when I open it with iPad Mini on iOS 7, the top part of UIImagePickerController
was hidden, which hide the front/back camera toggle button. How can I solve this?
Update: I observed through subview hierarchies that the "CAMFlipButton" has wrong frame:
<CAMFlipButton: 0x176e6250; baseClass = UIButton; frame = (310.5 9.5; 48 70); opaque = NO; layer = <CALayer: 0x176e63c0>>
I had the same issue; it seems to affect only the iPad Mini (but only the non-retina version), on both iOS 7 and 8. Not sure why not many people faced this issue, but I couldn't find a working solution or workaround.
So what I did (what I hacked!) is I detect when this happens (when the button ends up outside the window bounds), and correct it, by moving the button back into the window, and adding my own image to the button.
Why
UIScreen.mainScreen.bounds.size.width + 5
you ask? Simply because on the iPad Mini retina, that button has 4 pixels outside the window, but it still shows correctly, so I don't want to apply this hack then.My switch-camera image looks like this:
(hard to see, it's white! right-click or drag it around to see it...)