2013-07-25 53 views
0

我试图在横向模式下午餐百鸟SDK的照片编辑器,但它仅适用于iPad的! ,在iPhone上我的应用程序崩溃是由于这个问题:问题与百鸟SDK设备方向

“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运行,欣赏的任何帮助

回答

2

从鸟舍FAQ:

问:如何更改编辑器的支持方向?

答:关于iPhone的外形,编辑仅限于肖像呈现。 [...]

这意味着你想要什么是不可能的。编辑器必须以纵向模式运行。

+0

仍然崩溃!我什至做了一个子类,并设置shouldRotate为NO!但仍然崩溃! –

+1

@ Mc.Lover这是满意的行为。 SDK无法在横向模式下运行。您必须将'UIInterfaceOrientationPortrait'添加到支持的方向。 – Sulthan

+0

@SulthanIs无论如何要取消选中支持方向的肖像?因为我的应用程序只在横向模式下运行,如果我检查此选项屏幕旋转和'shouldAutoRotate'和其他屏幕旋转锁码将无法正常工作! –