gpt4 book ai didi

ios - Aviary SDK 设备方向问题

转载 作者:行者123 更新时间:2023-11-28 22:29:34 24 4
gpt4 key购买 nike

我正在尝试在横向模式下使用 Aviary SDK 照片编辑器,但它只能在 iPad 上运行!! ,由于这个问题,我的应用程序在 iPhone 上崩溃了:

'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning 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 常见问题解答:

Q: How do I change the supported orientations for the editor?

A: On the iPhone form factor, the Editor is restricted to Portrait presentation only. [...]

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

关于ios - Aviary SDK 设备方向问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17855858/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com