문제

I am presenting a UIImagePickerController on iPad with UIImagePickerControllerSourceTypeCamera. I know that the other UIImagePickerControllerSourceType options need to be presented in a UIPopoverController, but I doubt the camera should be.

That being said, I am presenting the camera from a modal view controller that is presented as a formSheet. Sometimes when I present the picker, it is shifted down a few pixels, like the status bar pushed it down:

enter image description here

Next, when I dismiss the picker, it has rotated my formSheet modal to portrait mode, but the underlying UISplitViewController is still in landscape:

enter image description here

What is happening here? Am I doing something wrong when presenting a UIImagePickerController from a modal form sheet?

도움이 되었습니까?

해결책

I found out what the issue was. I had the following in my UINavigationController subclass:

// Tell the system which initial orientation we want to have
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}

Removing that fixed the issue!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top