繁体   English   中英

Aviary SDK设备方向问题

[英]Issue with Aviary SDK device orientation

我正在尝试以横向模式午餐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上运行,感谢任何帮助

来自Aviary FAQ:

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

答:在iPhone外形尺寸上,编辑器仅限于纵向演示。 [...]

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM