I have an App where it displays a UIImagePickerController on launch. The controller displays the cancel button, but there is nothing to cancel to. Is there any way to remove the button?
NOTE: This is not a duplicate of Can the Cancel button be removed from a UIImagePickerController in OS 3.2?. The answer there for iOS 3.2 does not work for me in iOS 5.
I try to put UIImagePickerController not modally, but in original way (as we do it with ordinary custom UIViewController). So, I need no the cancel button in the UINavigationBar.
There are no documented ways to remove the cancel button. But here I found some idea.
I just added this code in my AppDelegate.m file:
So the cancel button is hidden now. But if you pick some folder in you photo albums the next view will be with that button (and it is not hidden).
Then I tried to add code like this:
I get the cancel button is hidden in all navigation stack inside UIImagePickerController’s navigation.
But while the new view is appearing (animation transition) the cancel button is appearing too.
I don’t know how to fix this problem.
However I think that it is a tricky and inefficient approach. Because it can break your application in the future iOS updates. So you can use the answer to that question. But it is different approach at all.
P.S. Sorry for my language.