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運行,欣賞的任何幫助
仍然崩潰!我什至做了一個子類,並設置shouldRotate爲NO!但仍然崩潰! –
@ Mc.Lover這是滿意的行爲。 SDK無法在橫向模式下運行。您必須將'UIInterfaceOrientationPortrait'添加到支持的方向。 – Sulthan
@SulthanIs無論如何要取消選中支持方向的肖像?因爲我的應用程序只在橫向模式下運行,如果我檢查此選項屏幕旋轉和'shouldAutoRotate'和其他屏幕旋轉鎖碼將無法正常工作! –