我正在创建一个处于横向模式的应用程序,我正在使用 UIImagePickerController
在其中使用 iPhone 相机拍照,我也想在横向模式下创建它。
但是正如 Apple 文档所暗示的那样,UIImagePickerController
不支持横向,那么我应该怎么做才能获得所需的功能?
最佳答案
如果您想在横向模式下使用 UIImagePickerController,请使用 user1673099's answer ,而不是:
- (BOOL)shouldAutorotate
{
return NO;
}
使用:
- (UIInterfaceOrientationMask)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}
然后选择器将以横向模式打开:
但请确保您在部署信息中检查了肖像:
关于ios - 横向使用 UIImagePickerController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19374237/