嗨,我正在开发一个只有肖像的通用应用程序。
所有视图控制器的方向都很好,但在UIImagePickerController类型中,TypeSavedPhotosAlbum始终以纵向显示(模态视图始终来自顶部,并且它与应用程序的其余部分的方向不同)。实际上在TypeCamera中,当相机出现时,您可以看到视图如何转过来。
我使用了apple教程中的默认代码:
- (BOOL) startCameraControllerFromViewController: (UIViewController*) controller
type:(UIImagePickerControllerSourceType)typeCamera
usingDelegate: (id <UIImagePickerControllerDelegate,
UINavigationControllerDelegate>) delegate {
if (([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypeCamera] == NO)
|| (delegate == nil)
|| (controller == nil))
return NO;
UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
cameraUI.sourceType = typeCamera;
cameraUI.allowsEditing = YES;
cameraUI.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeImage, nil];
cameraUI.delegate = delegate;
[self.navigationController presentViewController:cameraUI animated:YES completion:NULL];
return YES;
}
这是我的应用方向配置。
有什么想法吗?我尝试添加此解决方案:
Landscape-only app still autorotates to portrait in iOS7
但是(UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskPortrait);和(UIInterfaceOrientationMaskPortrait)。
我试图改变plist的方向,但我不知道我能做什么。
感谢!!!!!!
更新:
我刚试过
- (NSUInteger)navigationControllerSupportedInterfaceOrientations:(UINavigationController *)navigationController
{
return (UIInterfaceOrientationPortrait | UIInterfaceOrientationPortraitUpsideDown);
}
- (UIInterfaceOrientation)navigationControllerPreferredInterfaceOrientationForPresentation:(UINavigationController *)navigationController
{
return (UIInterfaceOrientationPortrait | UIInterfaceOrientationPortraitUpsideDown);
}
我还有问题:S。
谢谢!