我正在尝试以横向模式午餐Aviary SDK照片编辑器,但它仅适用于iPad !! ,由于这个问题,我的应用程序在iPhone上崩溃了:
'UIApplicationInvalidInterfaceOrientation',原因:'支持 方向与应用程序没有共同的方向,并且 shouldAutorotate返回YES'
我尝试了不同的方法但没有成功:
- (IBAction)photoEditor:(id)sender {
[self displayEditorForImage:imageBG.image];
}
- (void)displayEditorForImage:(UIImage *)imageToEdit
{
//set device orientation
[AFPhotoEditorCustomization setSupportedIpadOrientations:@[@(UIInterfaceOrientationLandscapeRight),
@(UIInterfaceOrientationLandscapeLeft) ]];
AFPhotoEditorController *editorController = [[AFPhotoEditorController alloc] initWithImage:imageToEdit];
[editorController setDelegate:self];
[self presentViewController:editorController animated:YES completion:nil];
}
这些代码都不起作用:
1-
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return ( (interfaceOrientation == UIInterfaceOrientationLandscapeRight) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeLeft) );
}
2-
-(BOOL)shouldAutorotate
{
return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;;
}
3-
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationLandscapeRight | UIInterfaceOrientationLandscapeLeft; // add any other you want
}
-(BOOL)shouldAutorotate
{
//tried NO too ,
return YES ;
}
我的应用程序在iOS 6上运行,感谢任何帮助
答案 0 :(得分:2)
来自Aviary FAQ:
问:如何更改编辑器支持的方向?
答:在iPhone外形尺寸上,编辑器仅限于纵向演示。 [...]
这意味着你想要的是不可能的。编辑器必须以纵向模式运行。