我在 iPad 上使用 UIImagePickerControllerSourceTypeCamera
展示一个 UIImagePickerController
。我知道其他 UIImagePickerControllerSourceType
选项需要在 UIPopoverController
中显示,但我怀疑相机应该是。
话虽这么说,但我正在从显示为 formSheet
的模态视图 Controller 中显示相机。有时,当我显示选择器时,它会向下移动几个像素,就像状态栏将它向下推一样:
接下来,当我关闭选择器时,它已将我的 formSheet
模态旋转为纵向模式,但底层的 UISplitViewController
仍处于横向:
这里发生了什么?从模态表单呈现 UIImagePickerController
时,我做错了什么吗?
最佳答案
我发现了问题所在。我的 UINavigationController
子类中有以下内容:
// Tell the system which initial orientation we want to have
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationPortrait;
}
删除它解决了问题!
关于ios - iPad:横向呈现 UIImagePickerController 会在关闭时旋转我的其他 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14309961/