【问题标题】:UIImagePickerController photos shutter not openingUIImagePickerController 照片快门未打开
【发布时间】:2015-06-23 09:39:09
【问题描述】:

我正在开发仅支持横向的 iPad 应用程序

我想要做的是,我想在按钮点击时打开照片库。 这是我的代码sn-p,

UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.modalPresentationStyle = UIModalPresentationCurrentContext;

当我写这篇文章时,它没有打开照片库:( 我不知道我在哪里做错了

请提前帮助和感谢。

【问题讨论】:

  • 添加presentViewcontroller方法

标签: ios iphone ipad uiimage photos


【解决方案1】:

试试这个:

UIImagePickerController *picker=[[UIImagePickerController alloc]init];
picker.delegate=self;
picker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;

if([[[UIDevice currentDevice] systemVersion] floatValue]>=8.0)
{
    [[NSOperationQueue mainQueue] addOperationWithBlock:^{
        [self presentViewController:picker animated:NO completion:nil];
    }];
}else{
    [self presentViewController:picker animated:YES completion:nil];
}

【讨论】:

  • 它崩溃并显示:UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'
猜你喜欢
  • 2013-08-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-09-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多