我想创建iPad相机,在此之前,我创建了纵向iPhone相机应用程序。
当我从相册(设备相册)中选择照片时,iPad应用程序抛出一个错误:
Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [PUUIAlbumListViewController shouldAutorotate] is returning YES'
下面是我从相册中选择照片的代码:
UIImagePickerController *pickerController = [[UIImagePickerController alloc] init];
pickerController.delegate = self;
pickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
pickerController.mediaTypes = @[(NSString *) kUTTypeImage];
pickerController.allowsEditing = NO;
[self presentViewController:pickerController animated:YES completion:nil];我必须添加什么才能从横向的iPad访问它?
发布于 2014-12-16 11:38:57
我找到了解决方案,结案了。我在我的应用程序中添加了。m
-(NSUInteger)application:(UIApplication *)application
supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
return UIInterfaceOrientationMaskAll;
else /* iphone */
return UIInterfaceOrientationMaskAllButUpsideDown;
}发布于 2016-10-12 20:11:00
-(NSUInteger)应用程序:(UIApplication*)应用程序窗口)窗口{if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) return UIInterfaceOrientationMaskAll;else / iphone */returnUIInterfaceOrientationMaskAllButUpsideDown;}
https://stackoverflow.com/questions/27496236
复制相似问题