[英]UIImagePickerController photos shutter not opening
i am developing iPad app which supports Landscape only 我正在开发仅支持横向的iPad应用
What i want to do is, i want to open photos library on button click. 我想做的是,我想在单击按钮时打开照片库。 Here is my code snippet,
这是我的代码段,
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.modalPresentationStyle = UIModalPresentationCurrentContext;
when i wrote this it doesn't open photos library :( I don't know where i am doing mistake 当我写这篇文章时,它不会打开照片库:(我不知道我在哪里做错
Please help and thanks in adavance. 请帮助并感谢您的先进。
Try this: 尝试这个:
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];
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.